C# 多线程

Thread thread = new Thread(ThreadStartUpdate);
thread.IsBackground = true;   //设为后台运行
thread.Start(); //开始线程

 

private void ThreadStartUpdate()
{
string errMsg = "";
PrintinterFace.StartUpdata(ref errMsg);
if (errMsg != "")
{
MessageBox.Show("上报数据失败!" + errMsg, "提示");
this.Enabled = true;
return;
}
}

posted @ 2022-04-21 17:10  KevinSteven  阅读(24)  评论(0编辑  收藏  举报