当前位置: 代码迷 >> 综合 >> C#编程,定时执行某种操作的一种方法。
  详细解决方案

C#编程,定时执行某种操作的一种方法。

热度:85   发布时间:2024-03-08 00:56:10.0
      //启动新线程public static void Start(){ThreadStart start = new ThreadStart(ThreadAction);Thread th = new Thread(start);th.IsBackground = true;th.Start();}public static void ThreadAction(){while (true){try{System.Threading.Thread.Sleep(3000);//每隔3秒执行的方法}catch { }}}

 

  相关解决方案