c# Timer_应用程序中生成定期事件
来源:互联网 发布:淘宝gta5刷钱靠谱吗 编辑:程序博客网 时间:2024/06/04 17:55
// 摘要: // 在应用程序中生成定期事件。 [DefaultEvent("Elapsed")] [DefaultProperty("Interval")] public class Timer : Component, ISupportInitialize static class Program { private static System.Timers.Timer aTimer; /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main() { // Create a timer with a ten second interval. aTimer = new System.Timers.Timer(10000); // Hook up the Elapsed event for the timer. aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent); // Set the Interval to 2 seconds (2000 milliseconds). aTimer.Interval = 5000; aTimer.Enabled = true; Console.WriteLine("Press the Enter key to exit the program."); Console.ReadLine(); } // Specify what you want to happen when the Elapsed event is // raised. private static void OnTimedEvent(object source, ElapsedEventArgs e) { MessageBox.Show(null,"test","test"); } }
0 0
- c# Timer_应用程序中生成定期事件
- 关于C#应用程序菜单,让程序中生成。
- 定期生成报表
- C#学习之生成事件
- VS中“生成事件
- C#窗体应用程序之Paint事件
- C#窗体应用程序之鼠标事件
- C#窗体应用程序之随机数生成
- C#生成的应用程序版本如何修改
- C#中使用事件
- C# 中事件
- C#中事件
- shell脚本定期生成phpdoc
- C#中生成快捷方式
- C#中动态编译应用程序
- C# 应用程序中更改图标
- C#中编写多线程应用程序
- C#中动态编译应用程序
- oracle基础教程:Oracle应用系统结构
- 设计模式 -单例模式
- java 加解密
- NYOJ-8 一种排序【sort与qsort】
- UVA-10361 Automatic Poetry
- c# Timer_应用程序中生成定期事件
- IPC之共享内存(1)
- c语言中i++,++i的计算
- URLDecoder.decode
- UVA-10815 Andy's First Dictionary
- saltstack安装配置笔记
- jsp 对request.getSession(false)的理解(附程序员常疏忽的一个漏洞)
- Redis集群部署与测试
- springMVC工作原理