/// <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);
}