C# ?????t???
???????????? ???????[ 2014/10/11 11:16:43 ] ????????NET c# ???????
?????????????????????????????????????????????????б??????????????????????????????????????????????е?????????????
????1. ????????????????
//define callback delegate
public delegate void CallBack(string result);
//process method
public void Processer(string args?? CallBack resultHandle)
{
//get result...
string result = "args is" + args;
//handle the result
resultHandle(result);
}
//handel the result
public void DisplayResult(string result)
{
Console.WriteLine(result);
}
//callback delegate example
public void Main()
{
Processer("??????????"?? new CallBack(DisplayResult));
}
?????????а????????????裺
????1. ?????????CallBack???????????????????????????
????2. ????????????????Processer???????????????????????????????????????????????????????????????????????????????
????3. ??????????巽??DisplayResult???÷???????????????????CallBack????????
????4. ??????????????Main???÷?????????????Processer????????“??????????”??????????????????ж??? new CallBack??DisplayResult????????DisplayResult???????ж????У????????Processer????????resultHandle????Precesser??????????????resultHandle(result);?????ж??????DisplayResult??????????????????????
??????????????????а???????????????·???PrintResult??????????????????????????????????????????????????????á???????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11