关于多线程中代理的一个小例子

来源:互联网 发布:淘宝上怎么关注达人 编辑:程序博客网 时间:2024/05/22 16:39

    最近朋友建议我写一些关于微软云技术的博客留给学校下一届的学生们看,怕下一届的MSTC断档。于是我也觉的有这个必要。写了几篇博客之后,我觉得也有必要把这一年的学习内容放在博客做个纪念,就这样写了本篇博客。


using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 代理引用{    class Program    {        delegate int MyDelegate(int p, int q);        static int Add(int a, int b)        {            return a + b;        }        static void Main(string[] args)        {            MyDelegate arithMethod = new MyDelegate(Add);            int r = arithMethod(3, 4);            Console.WriteLine("3和4的结果是:{0}", r);        }    }}

原创粉丝点击