我有这行代码这个方法有一个线程,它一直在运行以检查与系统时间相比的到期日期
Thread expireDateCheckThread;
DataTable _dt;
dbAccess db2;
DataTable _dt2;
public Search()
{
InitializeComponent();
db = new dbAccess();
_dt = new DataTable();
db2 = new dbAccess();
_dt2 = new DataTable();
expireDateCheckThread = new Thread(new ThreadStart(checkExpireDate));
expireDateCheckThread.Start();
}
public void checkExpireDate()
{
_dt2 = db2.checkExpireDate(DateTime.Now.ToString().Remove(9));
if (_dt2.Rows.Count != 0)
{
for (int i = 0; i < _dt2.Rows.Count; i++)
MessageBox.Show("Serial No: " + _dt2.Rows[i][0].ToString() + " is Going To Expired");
}
Thread.Sleep(1000 * 60 * 60 * 24);
checkExpireDate();
}
这在我的笔记本电脑上工作正常,但是当我在其他笔记本电脑上测试时,它显示应用程序无法正常工作
请帮我解决我的问题 提前谢谢