摘要:
标题比较抽象,所以我写了一个Demo来说明问题: public class A { public A() { Console.WriteLine("A的构造函数被调用"); } } public class B : A { private X x = new X(); //初始化器 } public class X { public X() { Console.WriteLine("X的构造函数调... 阅读全文
摘要:
问题起源于微软官方论坛中的一个帖子,他给出了一段VB.NET编写的代码: Dim stralltext As String = My.Computer.FileSystem.ReadAllText("c:\magic.txt") Dim StrLines() As String = stralltext.Split(ControlChars.CrLf)大家看第二行的Split方法调用,Contro... 阅读全文