zoukankan      html  css  js  c++  java
  • System.Timers.Timer的使用

    System.Timers.Timer的使用
    2008年11月04日 星期二 05:26 P.M.
  • using System;   
  •   
  • using System.Collections.Generic;   
  •   
  • using System.Linq;   
  •   
  • using System.Text;   
  •   
  • using System.Timers;   
  •   
  •   
  •   
  • namespace ConsoleApplication1   
  •   
  • {   
  •   
  •     class Program   
  •   
  •      {   
  •   
  •         static void Main(string[] args)   
  •   
  •          {   
  •   
  •              System.Timers.Timer aTimer = new System.Timers.Timer();   
  •   
  •              aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);   
  •   
  •             // Set the Interval to 5 seconds.   
  •   
  •              aTimer.Interval = 5000;   
  •   
  •              aTimer.Enabled = true;   
  •   
  •   
  •   
  •              Console.WriteLine("Press \'q\' to quit the sample.");   
  •   
  •             while (Console.Read() != 'q') ;   
  •   
  •          }   
  •   
  •   
  •   
  •         private static void OnTimedEvent(object source, ElapsedEventArgs e)   
  •   
  •          {   
  •   
  •              Console.WriteLine("Hello World!");   
  •   
  •          }   
  •   
  •      }   
  •   
  • }
查看全文
  • 相关阅读:
    移动平台开发需要的记录(续)
    移动平台开发需要的记录
    Chrome浏览器被劫持
    记录一个GO安装问题
    记录开发环境配置 MySql(5.7.17)+EF6.x+VS2017(15.7.1)
    win7(x64)下安装cocos2d并编译安卓项目
    Xocde一次版本升级遇到的问题 (Code Sign Error)
    【转】SqlServer将没有log文件的数据库文件附加到服务器中
    [转]IIS6.0迁移至IIS7.0
    重置VS设置
  • 原文地址:https://www.cnblogs.com/aaa6818162/p/1576496.html
  • Copyright © 2011-2022 走看看