/// <summary>
        /// 停下线程
        /// </summary>
        private void MyStopTask()
        {
            new Action(() => {
                if (thread != null)
                {
                    while (thread.ThreadState != System.Threading.ThreadState.Stopped)//必须等线程完全停止了,否则会出现冲突。  
                    {
                        try
                        {
                            buttonFun("登 录");
                            thread.Join();
                            Thread.Sleep(2000);
                         
                        }
                        catch (Exception ex)
                        {
                           
                        }
                    }

                }
            }).BeginInvoke(null, null);
           
        }

相关文章:

  • 2021-12-05
  • 2021-11-12
  • 2022-02-26
  • 2021-12-22
  • 2021-07-17
猜你喜欢
  • 2021-07-24
  • 2021-12-01
  • 2021-10-02
  • 2022-12-23
  • 2021-12-01
相关资源
相似解决方案