委托Delegate 1using System; 2using System.Collections.Generic; 3using System.Text; 4 5namespace deledate 6{ 7 delegate string Getstr(string str,float money); 8 9 class 你10 {11 static void Main(string[] args)12 { //你给我15块调用我去买香烟13 Console .WriteLine(我.买东西("香烟",15));14 }15 }1617 class 我18 { //我不会买,又委托他去买19 public static Getstr 买东西 = 他.买东西;20 }2122 class 他23 { //他拿到钱取买叫他买的东西24 public static string 买东西(string str,float money)25 {26 return str;27 }28 }29}