string[] a1={"1","2"};string[] a2={"2","3"};Ilist<string> jiaoji=new List<string>;Ilist<string> bingji=new List<string>;//交集foreach(string s1 in a1){foreach(string s2 in a2){if (s1=s2)jiaoji.add(s1);}}// 並集foreach(string s in
The GOF Abstract Factory Design Pattern In C#--Matthew Cochran Part I. Abstract Factory OverviewPart1.抽象原廠模式概述The abstract factory is a GOF (Gang of Four) creational pattern where the intent is to "...provide an interface for creating families of
我翻譯這篇文章寫得很好,解釋得很清楚,尤其是其圖文,讓人思路清晰,比MS提供的SDK上請的好懂多了,反正我當年看了好幾次還似懂非懂的。我還會翻譯我關於C#中的堆與棧的一個系列文章(共四篇),敬請期待哦。The C# Value Type and BoxingMatthew Cochran 儘管在.NET架構裡,我們不需要為記憶體管理以及垃圾收集操心,但我們還是應該瞭解它們,來最佳化我們的應用程式。其中之一便是,公用語言運行環境(CLR)是如何處理對實值型別的引用的。
http://blog.csdn.net/lovecady/article/details/2562026 當添加程式集引用時,可能會造成某種類型衝突,即你的應用程式在另一個程式集中定義的一個類型有相同的命名,那麼你就要為引用添加別名。當你為程式集添加別名時,在該程式集中使用過的命名空間將在別名下,而不是在global下被解析。要在一個程式集添加別名,首先在Visual Studio 2005中添加程式集的引用,然後,在解決方案管理器中開啟“引用”檔案夾,顯示引用的程式集屬性。還需要修改代碼:[
Sealed classes are used to restrict the inheritance feature of object oriented programming. Once a class is defined as sealed class, this class cannot be inherited. In C#, the sealed modifier is used to define a class as sealed. In Visual Basic