随笔分类 -  C# 2.0 & 3.0

摘要:public delegate void MyEventHandler (); public event MyEventHandler MyEvent; MyEvent += Raise(); MyEventHandler myHandler = obj.method;// instance or static method A deleage is a type that refere... 阅读全文
posted @ 2008-07-07 16:15 许晓光 阅读(276) 评论(0) 推荐(0)
摘要:private string delstr(string theoldstr,string startstr,string endstr) { string teststr=theoldstr; int StartPosition=teststr.IndexOf(startstr); ... 阅读全文
posted @ 2008-04-30 09:53 许晓光 阅读(7213) 评论(1) 推荐(0)
摘要:The out keyword causes arguments to be passed by reference. This is similar to the ref keyword, except that ref requires that the variable be initialized before being passed. 阅读全文
posted @ 2008-04-11 11:02 许晓光 阅读(324) 评论(1) 推荐(0)
摘要:1using System; 2using System.Collections.Generic; 3using System.Text; 4 5namespace ConsoleApplication1 6{ 7 class Program 8 { 9 static void Main(string[] args) 10 { 11 ... 阅读全文
posted @ 2008-04-08 10:18 许晓光 阅读(768) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2008-03-12 17:02 许晓光 阅读(305) 评论(0) 推荐(0)
摘要:1public class ItemInfo : ItemInfoFac,IMember 2{ 3 private string m_Name = string.Empty; 4 5 public override void GetDateTime() 6 { 7 8 } 9 10 public void GetName() 11 { } 1... 阅读全文
posted @ 2007-12-12 15:29 许晓光 阅读(432) 评论(0) 推荐(0)
摘要:A string is basically a sequence of characters. Immutable 阅读全文
posted @ 2007-12-10 18:23 许晓光 阅读(393) 评论(0) 推荐(0)
摘要:2. 不定项选择: (1) 以下叙述正确的是: A. 接口中可以有虚方法。 B. 一个类可以实现多个接口。 C. 接口不能被实例化。 D. 接口中可以包含已实现的方法。 inheritance polymorphism encapsulation 1class A 2 { 3 4 public virtual ... 阅读全文
posted @ 2007-10-30 09:31 许晓光 阅读(520) 评论(0) 推荐(0)
摘要:const 属性是在编译时初始化,而readonly属性是在运行时初始化。 1.method private hidebysig static void Main(string[] args) cil managed 2{ 3 .entrypoint 4 // Code size 24 (0x18) 5 .maxstack 8 6 IL_000... 阅读全文
posted @ 2007-09-20 14:58 许晓光 阅读(219) 评论(0) 推荐(0)
摘要:http://msdn2.microsoft.com/en-us/library/25z57t8s(VS.80).aspx 阅读全文
posted @ 2007-09-18 15:29 许晓光 阅读(185) 评论(0) 推荐(0)
摘要:.NET Framework 类库提供了静态方法public static bool ReferenceEquals ( Object objA, Object objB ) 确定指定的 Object 实例是否是相同的实例。也就是比较引用类型是否是对同一个对象的引用。 对于值类型,如果对象的值相等,则相等运算符 (==) 返回 tr... 阅读全文
posted @ 2007-09-18 13:49 许晓光 阅读(873) 评论(0) 推荐(0)
摘要:周六开始看这本书! 本书围绕一些重要的主题,包括C#语言元素、.NET资源管理、使用C#表达设计、创建二进制组件和使用框架等,讲述了最常见的50个问题的解决方案,为程序员提供了在使用C#语言和.NET库时如何提高编程效率的建议。本书通过将每个条款构建在之前的条款之上,并合理地利用之前的条款,来让读者最大限度地学习书中的内容,为其在不同的情况下能够使用最佳的构造而提供指导。. 本书适于各种层次的... 阅读全文
posted @ 2007-09-17 09:26 许晓光 阅读(401) 评论(0) 推荐(0)