什麼是 AJAX 程式庫 API?
http://code.google.com/intl/zh-TW/apis/ajaxlibs/

Develop Guide
http://code.google.com/intl/zh-TW/apis/ajaxlibs/documentation/index.html

give 發表在 痞客邦 留言(0) 人氣()

虛擬光碟
Virtual Clonedrive 5.4.1.1
http://static.slysoft.com/SetupVirtualCloneDrive.exe

燒錄軟體
InfraRecorder(支援x64)
http://infrarecorder.org/?page_id=5

give 發表在 痞客邦 留言(0) 人氣()

以下內容大部分取自MSDN
ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.cht/fxref_mscorlib/html/8cf32466-55b9-e0bf-37eb-39af84aa3021.htm

IEnumerator 是所有非泛型列舉值的基底介面。

任何實做此類別的物件才能使用foreach來列舉,列舉值可以用來讀取集合中的資料,但是無法用來修改基礎集合。

列舉可以想像成是間隔與間隔中間的指示牌,利用指示牌來指出物件串列中,目前所在(Current)的是哪個物件,並可以往下前進(MoveNext)。任何物件都必須實做IEnumerator和IEnumerable的兩個介面,其中實做IEnumerable是物件序列,必須實做GetEnumerator()回傳實做IEnumerator的物件來進行列舉。

列舉值沒有集合的獨佔存取權,因此,列舉一個集合在本質上並不是執行緒安全的程序。即使集合經過同步化,其他的執行緒仍可修改該集合,使列舉值擲回例外狀況。若要保證列舉過程的執行緒安全,您可以在整個列舉過程中鎖定集合,或攔截由其他執行緒的變更所造成的例外狀況。

give 發表在 痞客邦 留言(0) 人氣()

本文引用自 ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.cht/fxref_mscorlib/html/bc3d7d70-886c-6572-18cd-3e82f6aeeabe.htm

Attribute 類別會將預先定義的系統資訊或使用者定義的自訂資訊,與目標項目產生關聯。目標項目可為組件 (Assembly)、類別、建構函式 (Constructor)、委派 (Delegate)、列舉、事件、欄位、介面、方法、可移植執行檔案模組、參數、屬性 (Property)、傳回值、結構或其他屬性 (Attribute)

屬性提供的資訊也稱為中繼資料 (Metadata)應用程式可在執行階段檢查中繼資料,來控制程式處理資料的方式,也可以在執行階段前,利用外部工具,來控制應用程式如何對其本身進行處理或維護(補充1)。例如,.NET Framework 可預先定義並使用屬性型別來控制執行階段行為,部分程式語言則可使用屬性 (Attribute) 型別,來表示 .NET Framework 一般型別系統未直接支援的語言功能。

所有屬性 (Attribute) 型別都是直接或間接衍生自 Attribute 類別。屬性 (Attribute) 可以套用至任何目標項目;多個屬性 (Attribute) 可以套用至同一個目標項目;衍生自目標項目的項目可以繼承屬性 (Attribute)。請使用 AttributeTargets 類別,指定要套用屬性的目標項目。

Attribute 類別包含便於擷取及測試自訂屬性 (Attribute) 的方法。如需屬性用法的詳細資訊,請參閱使用屬性擴充中繼資料(MSDN)。

 

補充1: 為什麼可以達成這樣,可參考範例中建立屬性的方法。每個套用的屬性在使用前都會經過屬性物件的包裹再執行原程式,這包裹的過程可以對目標物件進行處理。

 

give 發表在 痞客邦 留言(1) 人氣()

在網頁上呼叫 DataBind
方法時,資料繫結運算式便會在伺服控制項屬性和資料來源之間建立繫結。您可以將資料繫結運算式包含在伺服器控制項開頭標記中屬性/值配組中值的那一端,或是網頁上的任何位置。

- or - literal text <%# data-binding expression %>

# 所有的資料繫結運算式都必須包含在 <%# 和 %> 字元之間。

# 資料繫結運算式使用 EvalBind
方法將資料繫結至控制項,並將變更送回資料庫。Eval 方法是一種靜態 (唯讀)
方法,會取得資料欄位的值,並且將其以字串的形式送回。Bind
方法支援讀/寫功能,並具有擷取資料繫結控制項之值,以及將所有變更都送回資料庫的能力。

# 使用 XPathXPathSelect
方法,以及 XPathBinder 類別,即可從
XmlDataSource
控制項繫結至 XML 資料。

Sample
    
        void SubmitBtn_Click(Object sender, EventArgs e) {
          // Rather than explictly pulling out the variable from the StateList control
          // and then manipulating a Label control, just call Page.DataBind.
          // This will evaluate any <%# %> expressions within the page.   
          Page.DataBind();
        }
    

    

Binding to a property of another server control

    
        
          CA
          IN
          KS
          MD
          MI
          OR
          TN
          UT
               
                
        

    

        Selected State:     
    

可參考下列連結

give 發表在 痞客邦 留言(0) 人氣()

  1. 下載Log4Net
    http://logging.apache.org/log4net/download.html
  2. 解開,在專案中加入參考
  3. 設定好config.xml (範例可google一下)
  4. 加入
    using log4net;
    using log4net.Config
  5. 取得config.xml,類似以下範例
    XmlConfigurator.Configure(new System.IO.FileInfo(Server.MapPath("config.xml")));
  6. 宣告 (ClassName替換成使用中的Class)
    private static readonly ILog log = LogManager.GetLogger(typeof(ClassName));
  7. Done!

 

give 發表在 痞客邦 留言(0) 人氣()

1.獲取和設置當前目錄的完全限定路徑。

string str = System.Environment.CurrentDirectory;

Result: C:\xxx\xxx

2.獲取啟動了應用程序的可執行文件的路徑,不包括可執行文件的名稱。

string str = System.Windows.Forms.Application.StartupPath;

Result: C:\xxx\xxx

3.獲取新的 Process 組件並將其與當前活動的進程關聯的主模塊的完整路徑,包含文件名。

string str = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;

Result: C:\xxx\xxx\xxx.exe

4.獲取當前 Thread 的當前應用程序域的基目錄,它由程序集衝突解決程序用來探測程序集。

string str = System.AppDomain.CurrentDomain.BaseDirectory;

Result: C:\xxx\xxx\

5.獲取應用程序的當前工作目錄。

string str = System.IO.Directory.GetCurrentDirectory();

Result: C:\xxx\xxx

6.獲取和設置包含該應用程序的目錄的名稱。

string str = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;

Result: C:\xxx\xxx\

7.獲取當前進程的完整路徑,包含文件名。

string str = this.GetType().Assembly.Location;

Result: C:\xxx\xxx\xxx.exe

8.獲取啟動了應用程序的可執行文件的路徑,包括可執行文件的名稱。string str = System.Windows.Forms.Application.ExecutablePath;



Result: C:\xxx\xxx\xxx.exe

此外,更多見的通過XML文件配置具體的路徑來達到合理的規劃配置文件的具體存放位置,如WEB中的配置文件中的路徑。

give 發表在 痞客邦 留言(0) 人氣()

<asp:GridView ID="gvResult2" runat="server" CssClass="table-view"
    DataKeyNames="MetadataId" DataSourceID="ObjectDataSource1">
    <RowStyle CssClass="row-item" />
    <Columns>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:CheckBox ID="CheckBox1" runat="server" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="序號">
            <ItemTemplate>
                <%# Container.DataItemIndex + 1 %></ItemTemplate>
        </asp:TemplateField>
    </Columns>
    <FooterStyle CssClass="row-foot" />
    <AlternatingRowStyle CssClass="row-alter" />
</asp:GridView>

give 發表在 痞客邦 留言(0) 人氣()

時間字串的資料如下:
2008/10/21 下午 06:01:39

現在要透過c#將資料寫回oracle內,若直接使用

TO_DATE('2008/10/21 下午 06:01:39', 'yyyy-mm-dd hh:mi:ss')

會造成 ORA-01858: a non-numeric character was found where a numeric was expected

解法:

1.先用將原始字串轉換

Convert.ToDateTime("2008/10/21 下午 06:01:39").ToString("u")

u是 Universal sortable (invariant) 格式,輸出結果像是 2006-04-17 21:22:48Z
(ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.cht/fxref_mscorlib/html/35b48850-3558-6011-1368-facb5f7986bd.htm#seeAlsoToggle)

字尾有多個Z,用Substring砍掉

Convert.ToDateTime(payDate).ToString("u").Substring(0, 19)

2. 使用TO_DATE寫回Date欄位

TO_DATE('<將轉換過的字串代入>', 'yyyy-mm-dd hh24:mi:ss')

 

Sample:

string payTool = (node.SelectSingleNode(".//PayTool")).InnerText;      
string paySerial = (node.SelectSingleNode(".//PaySerial")).InnerText; 
string payResult = (node.SelectSingleNode(".//PayResult")).InnerText;  
string payDate = (node.SelectSingleNode(".//AuthorizeDateTime")).InnerText;

string sql = string.Format("UPDATE ORDERS SET HOWTOPAY = '{0}', PAYRESULT = '{1}', PAYDATE = TO_DATE('{2}','yyyy-mm-dd hh24:mi:ss'), STATUS = '{3}' WHERE ID = '{4}'", payTool, payResult, Convert.ToDateTime(payDate).ToString("u").Substring(0, 19), "1", paySerial);

give 發表在 痞客邦 留言(1) 人氣()

在<system.web>中加上以下參數
<webServices>
      <protocols>
        <add name="HttpPost"/>
        <add name="HttpGet"/>
      </protocols>
</webServices>



比較完整的範例
<configuration>
<system.web>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
</system.web>
</configuration>

give 發表在 痞客邦 留言(0) 人氣()