跳到主要內容

發表文章

目前顯示的是 2月, 2012的文章

[CSS]Div 水平並排

之前在是DIV怎麼水平並排 一直搞不定會有奇怪的問題 之後才發現一是個小小的css就可以處理了 水平並排後的物件要用 css : clear:both; 重新整理一下 <style type="text/css"> <!-- .ImageList{ float: left; } .clearfloat { clear:both; height:0; font-size: 1px; line-height: 0px; } --> </style> <div id="image1" class="ImageList"><img src="images/image.jpg" /></div> <div id="image2" class="ImageList"><img src="images/image.jpg" /></div> <div id="image3" class="ImageList"><img src="images/image.jpg" /></div>121323 <br class="clearfloat" />6 112ds3a <div id="image4"><img src="images/image.jpg" /></div>
Gridview 轉 EXCEL 欄位變成 0 這一個問題是這樣子,在gridview 中有一個欄位是..00000 ;它是長這樣子,它是文字,並不是數字,可是在轉成Excel 時,它會變成 0 ,這樣就很不好,因為它本來的意義就是字串 0,那...Excel 為何要自做主張,把它轉成0 呢...還好有解法~~ row.Cells[3].Attributes.Add("style", "vnd.ms-excel.numberformat:@"); 要加上面這一行指令,不過你可能要先去跑整個 GridView ,找出你那個不要轉成0的欄位,在它的cells.attribute 中加入,這樣就可以解決那個問題了..試試看先。

Google Translate for web page

Google 提供了一個java Script 可以讓自己的網站用google翻譯成你要的語言 不只是可以用在blog上 也可以用在個人或公司的網站上 不過翻譯的好不好 見仁見智囉 詳情可以看這邊 google翻譯

[Error]TNS-03505: 無法決定名稱

測試環境: WinXP SP2、Oracle 10g( 10.2.0.1.0 ) C:\Documents and Settings\User>tnsping $SID TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 07-12月- 2007 15:01:52 Copyright (c) 1997, 2005, Oracle. All rights reserved. 已使用的參數檔案: C:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora 使用 TNSNAMES 轉接器來解析別名 Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = cimsdb))) OK (20 msec) C:\Documents and Settings\aiia>tnsping cimsdbv1 TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 07-12月- 2007 15:01:56 Copyright (c) 1997, 2005, Oracle. All rights reserved. 已使用的參數檔案: C:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora TNS-03505: 無法決定名稱 C:\Documents and Settings\aiia>tnsping cimsdbv2 TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 07-12月- 2007 15:02:02 Copyright (c) 1997, 2005, Oracle. All rights reserved.

[Web Service] Web service return json

Webservice 要output JSON格式的資料 在web service中 method 要加上 [ScriptMethod(ResponseFormat:=ResponseFormat.Json)] _ class 要先設定[ScriptService()] 這樣Jquery.ajax才能使用 [web service] Imports System.Net Imports System.IO Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.Web.Script.Services Imports System.ComponentModel Imports net.gallerys.common.util Imports PLaiN.dll Imports log4net Imports Newtonsoft.Json <System.Web.Services.WebService(Namespace:="http://tempuri.org/")>_ <System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _ <ToolboxItem(False)> _ <ScriptService()> _ Public Class WebService Inherits System.Web.Services.WebService <WebMethod()> _ Public Function HelloWorld() As String Return "Hello World" End Function <WebMethod()> _ <ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _ Function Li

[.NET] HTML Parser --HTML Agility Pack

HTML Agility Pack 提供了用XPath去分析 html的結構的功能 用於要抓網站資料的時候很有用 下面是用 HTML Agility Pack以Xpath的語法去抓yahoo股市資料的code Dim client As New WebClient() Dim sr As Stream = client.OpenRead("http://tw.stock.yahoo.com/q/q?s=2409") Dim doc As New HtmlAgilityPack.HtmlDocument() doc.Load(sr, System.Text.Encoding.GetEncoding("big5")) Dim nodes As HtmlAgilityPack.HtmlNodeCollection = doc.DocumentNode.SelectNodes("/html/body/center/table[2]/tr/td/table/tr[2]/td") If nodes IsNot Nothing Then For Each node As HtmlAgilityPack.HtmlNode In nodes Console.WriteLine(node.InnerText.Trim()) Next End If Console.ReadLine() Xpath 的語法 可以參考 XPath Tutorial sample on MSDN Download HTML Agility Pack