//启动新线程
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 { }
}
}
C#编程,定时执行某种操作的一种方法。
猜你喜欢
转载自blog.csdn.net/qq_43307934/article/details/86290311
今日推荐
周排行