摘要: 类集与名称空间的关系.NET文档中对两者关系的描述是:“名称空间在概念上与类集成正交关系”。用更通俗的话说,它们之间没有任何直接联系。一个名称空间中的类可能分布在几个类集当中,一个类集也可能包含几个不同的名称空间中类的实现。系统类库中确实存在很多同名的类集和名称空间,但那只能说是命名上的巧合罢了。下表列出了常用的名称空间以及它们的实现类集之间的对应关系: 名称空间对应的类集Systemmscorlib,SystemSystem.IOmscorlib,SystemSystem.XmlSystem.Data, System.XmlSystem.DataSystem.DataSystem.NetSy 阅读全文
posted @ 2013-03-25 17:55 Predator 阅读(591) 评论(0) 推荐(0) 编辑
摘要: 首先编写类库源代码using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace CustomLib{ /// <summary> /// 自定义业务异常,本系统所有其它自定义异常,需从本类派生 /// </summary> public class MyCustomLib { /// <summary> /// 该方法用于打印姓名 /// </summary> public static void Display(string 阅读全文
posted @ 2013-03-25 16:15 Predator 阅读(207) 评论(0) 推荐(0) 编辑
摘要: private void txtDeposit_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar==13)//按下回车键释放鼠标后弹出消息框执行.this.btnComfir_Click(this, e)函数 { this.btnComfir_Click(this, e); } } private void txtDeposit_KeyDown(object sender, KeyEventArgs e) { if (e.KeyValue == 65)//按下A立刻弹出消息框keydown. { // this.btnCo 阅读全文
posted @ 2013-03-25 14:59 Predator 阅读(210) 评论(0) 推荐(0) 编辑
摘要: class TestMain { delegate string Fun(string str); public static void ShowMsg(string msg) { Console.WriteLine(msg); } public static void Main() { //Fun f = ShowMsg; //f("Hello ,I am Jesson"); Fun f = X => X; string str=f("Hello"); Console.WriteLine(str); Console.Read(); } }而“语句 阅读全文
posted @ 2013-03-25 09:07 Predator 阅读(115) 评论(0) 推荐(0) 编辑