惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

TaoSecurity Blog
TaoSecurity Blog
Jina AI
Jina AI
雷峰网
雷峰网
月光博客
月光博客
The GitHub Blog
The GitHub Blog
WordPress大学
WordPress大学
B
Blog RSS Feed
美团技术团队
C
CXSECURITY Database RSS Feed - CXSecurity.com
小众软件
小众软件
Security Latest
Security Latest
Microsoft Azure Blog
Microsoft Azure Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
Last Week in AI
Last Week in AI
A
Arctic Wolf
Latest news
Latest news
Attack and Defense Labs
Attack and Defense Labs
I
Intezer
F
Fortinet All Blogs
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
Webroot Blog
Webroot Blog
S
Secure Thoughts
Help Net Security
Help Net Security
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
V
Visual Studio Blog
P
Proofpoint News Feed
博客园 - 【当耐特】
P
Privacy International News Feed
V
Vulnerabilities – Threatpost
Stack Overflow Blog
Stack Overflow Blog
Know Your Adversary
Know Your Adversary
云风的 BLOG
云风的 BLOG
Hacker News: Ask HN
Hacker News: Ask HN
L
LINUX DO - 最新话题
H
Help Net Security
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
T
Tailwind CSS Blog
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tenable Blog
Cloudbric
Cloudbric
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog

博客园 - ant520

GNS3的使用2 SecureCRT 应用 sql 2000 修复问题 GNS3的使用 虚拟机-文件 无法显示隐藏文件的解决方法 看QQ是否在线 百度地图指南 sql 知识摘录 配置静态路由使用出站接口和下一跳IP的差别 如何计算冲突域和广播域-图解分析 240多个jQuery插件 C#中使用SQLite数据库 Visual studio 配置文件下载 SQL2000 安装,挂起 在口上打对钩√ DataTab转换XML XML转换DataTable 的类[转] excel 2003系列 全角转半角与半角转全角
委托/事件
ant520 · 2011-04-07 · via 博客园 - ant520
public class Program
 {
       delegate void CallFunction(object para);//定义委托[和定义方法一个样,简单理解为static 换成了delegate]
       private static event CallFunction CallEvenHandle;//定义事件[简单理解,有事件必有委托]
        static void Main(string[] args)
        {
            //调用委托,之前定义像方法,这里new了一个实例,和js的new一个function 差不多
           CallFunction cf = new CallFunction(WritePara);
            cf.Invoke("goodmorning");

         //调用事件,打上"+="后按"Tab"键就出来了,简单使用 
         CallEvenHandle += new CallFunction(WritePara);
            CallEvenHandle("CYQ");

            //Console.Read();
        }

        protected static void WritePara(object para)
        {
            Console.WriteLine("hello:"+para);
        }
    }

摘要:http://www.cnblogs.com/cyq1162/archive/2008/04/16/1155811.html