下面的程式碼範例闡釋了如何使用 GetEnumerator 方法。view plaincopy to clipboardprint?// Get 'Validators' of the page to myCollection. ValidatorCollection myCollection = Page.Validators; // Get the Enumerator. IEnumerator myEnumerator = myCollection.GetEnumerato
碰巧看到呂震宇 兄的文章 C#設計模式(1) ,中提到 先有雞還是先有蛋 的代碼using System;class Client{ public static void Main () { Base b = new Base(); Derived d = new Derived(); b.d = d; Console.WriteLine(b.d.m); }}class Base{ public int n =
部署完exchange server 2003中文版之後不久,客戶給了100多個email地址,讓我添加進入。於是便找點資料,想做個大量建立的程式,不也快哉!可是網上開發exchange的中文資料太少,搞了幾天也沒搞好,或者手工輸入都弄好了。 由於公司裡沒有網域服務器,客戶那邊有兩台,一台裝exchange,一台裝vs2003,程式調試挺麻煩的,加上是遠程用vnc串連,速度也慢。 先是homeMDB不對,手寫上去的不對。
項目是VS2003下的,用到了CreateThread函數,看到網上說不應該調用CreateThread,而應該使用_beginthreadex。因為剛好用到了,就還是寫一下CreateThread中參數的使用方法。見代碼:先定義要傳遞的參數結構體:typedef struct SParam{ int No; unsigned short chnlID; unsigned short sessionID;}uParam,*sParam;DWORD
最近加入一個C++的學習群,群裡免不了有些網友提問題。我也正好學習一下。把一些問題,一些小程式記錄下來,讓自己的C++水平慢慢提上來......函數功能:把輸入的字串中的標點符號去掉之後輸出來,迴圈執行如果輸入的字串沒有標點符號,他就輸出Nopunctuation character in the string ?!Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.
我們都知道,類是有成員的,而類的成員是另一個使用者定義的類型也是完全有可能。偶爾的,被包含的類可以為其外層類的服務而存在,因為它不必要向外界暴露。其實,嵌套類就是一個輔助類。這就是嵌套類。 嵌套類的好處是可以對外層類的所有成員進行訪問。嵌套類的方法可以訪問外層類的私人成員。這裡要說明一點:公用的嵌套類可以在外層類的範圍內訪問。 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.
Script# supports programming against Silverlight 1.0. You can start writing your RIA and associated components and controls in C# rather than in JavaScript... today! This series of posts will build a photo carousel one step at a time to illustrate