using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace ConsoleApplication1
{
delegate void MyDelegate(int i);
class Program
{
public static void Main()
{
TakesADelegate(new MyDelegate(DelegateFunction));
Console.ReadLine();
}
public static void TakesADelegate( MyDelegate SomeFunction)//给代理函数形参赋值
{
SomeFunction(21);
}
public static void DelegateFunction(int i)
{
System.Console.WriteLine("代理调用的数字:{0}.",i);
}
}