观看C#高级教程进行学习。巩固基础,进阶学习。
1.委托
把方法当做参数来传递就是委托。委托的关键字是delegate。

class Program
{
private delegate string GetString();
static void Main(string[] args)
{
int x=40;
GetString a = x.ToString;//方法签名
string t = a();
Console.WriteLine("{0}", t);
Console.ReadKey();
}
}
Invoke方法也可以调用委托所引用的方法。
