La programación en C # es una forma de realizar determinadas operaciones de forma regular.

      //启动新线程
         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 { }
            }
        }

 

Supongo que te gusta

Origin blog.csdn.net/qq_43307934/article/details/86290311
Recomendado
Clasificación