C# 学习笔记

 .Net FrameWork 2.0 命名空间
1)分为两类:以Microsoft限定的命名空间;以System限定的命名空间
2) C#中的常用命名空间
Microsoft.Win32
Microsoft.Csharp
System.Collections
System.Configuration
System.Data
System.Data.SqlClient
System.Diagnostics
System.Drawing
System.EnterpriseServices
System.Globalization
System.IO
System.Management
System.Messaging
System.Net
System.Net.Mail
System.Reflection
System.Resources
System.Runtime
System.Runtime.Remoting
System.Runtime.Serialization
System.Security
System.Text
System.Threading
System.Transactions
System.Web
System.Web.Caching
System.Web.Configuration
System.Web.Security
System.Web.Services
System.Web.UI
System.Web.UI.WebControls
System.Windows.Forms
System.Windows.Forms.Design
System.Xml
其余参考: MSDN

类和结构
1) C#类的成员都有哪些呢?
2) 类和结构区别在哪?
最大区别是:
结构是值类型,不需要堆分配,直接分配在堆栈上
类是引用类型,需用new运算符去实例化
注:结构中可包含数据成员和函数成员
3)C#支持两种构造函数:Instance Constructor和Static Constructor
4) 静态构造函数的特点:
需static关键字,初始化静态字段,只读字段等,私有的。不可继承
5) 定义属性和索引器
索引指示器举例
6) 定义方法、事件和方法重载
a) 事件有两种:
内置事件(页面事件、控件事件等)

自定义事件

以下是自定义事件举例代码:

自定义事件

 

posted @ 2008-09-22 19:47  zqblog007  阅读(197)  评论(0编辑  收藏  举报