摘要: delegate int del(int i);static void Main(string[] args){ del myDelegate = x => x * x; int j = myDelegate(5); //j = 25}创建表达式树类型:using System.Linq.Expressions;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { Expression<del> myET = x ... 阅读全文
posted @ 2013-04-03 17:13 louiskoo 阅读(150) 评论(0) 推荐(0) 编辑
摘要: class Test{ delegate void TestDelegate(string s); static void M(string s) { Console.WriteLine(s); } static void Main(string[] args) { // Original delegate syntax required // initialization with a named method. TestDelegate testDelA = new TestDelegate(M)... 阅读全文
posted @ 2013-04-03 15:45 louiskoo 阅读(200) 评论(0) 推荐(0) 编辑
摘要: // Create a handler for a click event.button1.Click += delegate(System.Object o, System.EventArgs e) { System.Windows.Forms.MessageBox.Show("Click!"); };// Create a delegate.delegate void Del(int x);// Instantiate the delegate using an anonymous method.Del d = delegate(int k) { /* ... 阅读全文
posted @ 2013-04-03 15:34 louiskoo 阅读(110) 评论(0) 推荐(0) 编辑
摘要: http://msdn.microsoft.com/zh-cn/library/ms173171 阅读全文
posted @ 2013-04-03 15:30 louiskoo 阅读(225) 评论(0) 推荐(0) 编辑
摘要: http://msdn.microsoft.com/zh-cn/library/8627sbea 阅读全文
posted @ 2013-04-03 15:21 louiskoo 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 在C#中,你给一个方法传输参数时,实际上是使用的这个参数的一个副本,就是将原来的变量复制一份,然后传给一个方法,让其进行操作。所以在方法内部对参数的修改等不会对原来的参数造成影响。但是有些时候,又需要这种影响。ref的作用就是这个。它将变量本身而不是副本传给方法,所以对参数的修改原来变量的值。int a = 0;Console.WriteLine(a.ToString()); //输出是0public void ModifyVaule(ref int a){ a = 1;}Console.WriteLine(a.ToString()); // 输出是1。此外,out修饰符也起到这个作用... 阅读全文
posted @ 2013-04-03 13:31 louiskoo 阅读(177) 评论(0) 推荐(0) 编辑
摘要: http://www.teamviewer.com/zhCN/index.aspx 阅读全文
posted @ 2013-04-03 13:09 louiskoo 阅读(152) 评论(0) 推荐(0) 编辑