摘要:
1、先看一个委托的例子 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace DeleGate 7 { 8 public delegate void GreetingDelegate(string name);//委托 9 10 class Program11 {12 private static void EnglishGreeting(string name)13 {14 ... 阅读全文
摘要:
1、结构跟C中类似,优点:集中处理常见任务,简化过程; 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace StructTest 7 { 8 struct huanghuang 9 { 10 public string firstName,lastName;11 public string wholeName()12 { 13 return f... 阅读全文
摘要:
1、C#的变量仅能从代码的本地作用域访问,访问该变量要通过这个作用域来实现写个例子:(1)访问不了的情况 error 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace bianliang 7 { 8 class Program 9 {10 11 static void display()12 {13 Console.WriteLine("result:{0... 阅读全文