-
C#教程之监听
本站最新发布 C#从入门到精通
试听地址 https://www.xin3721.com/eschool/CSharpxin3721/
试听地址 https://www.xin3721.com/eschool/CSharpxin3721/
public partial class Form1 : Form { public Form1() { InitializeComponent(); Dog dog = new Dog(); InsertDog(dog); dog.OnAlert(); //Console.WriteLine(); } public void InsertDog(Dog dog) { dog.alertHandler += new Dog.AlEventHandler(HostEventHandler); } public void HostEventHandler(object sender, EventArgs e) { Console.WriteLine("{0}\n",sender.ToString()); } } public class Dog { public delegate void AlEventHandler(object sender, EventArgs e); public event AlEventHandler alertHandler; protected int tm = 0; public void OnAlert() { if(this.alertHandler!=null) { while (true) { if (tm == 100) { this.alertHandler(this.tm, new EventArgs()); Console.WriteLine("2\n"); tm = 0; } tm++; Thread.Sleep(10); } } } }
栏目列表
最新更新
Winform中怎样跨窗体获取另一窗体的控件对
Winform中使用FastReport的PictureObject时通过代
三分钟掌握,使用Quqrtz.Net实现定时发送邮
NET/Regex 处理连续空格
QR 码详解(下)
C#中的等值判断1
C#编写了一个基于Lucene.Net的搜索引擎查询
使用FastReport报表工具生成报表PDF文档
基于JieBaNet+Lucene.Net实现全文搜索
C#取视频某一帧图片
.Net Standard(.Net Core)实现获取配置信息
Linux PXE + Kickstart 自动装机
Shell 编程 基础
Shell 编程 条件语句
CentOS8-网卡配置及详解
Linux中LVM逻辑卷管理
1.数码相框-相框框架分析(1)
Ubuntu armhf 版本国内源
Linux中raid磁盘阵列
搭建简易网站
Dubbo(五):深入理解Dubbo核心模型Invok
vfp教程之VFP与Excel交互编程
vfp教程之在VFP中实现跟变式组合框及椭圆
SQL SERVER查询数据库所有表的大小,按照记
使用 SQL 服务器时,"评估期已过期"错
sql server无法连接本地服务器
使用sql语句创建表
VB操作Access数据库小记 ————————
access数据库远程连接
java web操作Access数据库