private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
{
if (this._isClose)
{
try
{
this.MainThread.Abort();
}
catch
{
}
try
{
this.MainThread2.Abort();
}
catch
{
}
try
{
this.MainThread3.Abort();
}
catch
{
}
if (this._curTask.Stu != "" && this.rw_chk_Addtp.Checked)
this.postTask(0);
loginForm.Close();
e.Cancel = false;
}
else if (MessageBox.Show("确定要退出爱流量吗?退出后您的任务将暂停执行", "退出", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
TasksClass tasksClass = new TasksClass();
if (sys.LoginUser.hyDj <= 8)
{
string strsql = "update tasks8 set stu='暂停' where stu='等待中' and userid=" + (object)sys.LoginUser.ID;
tasksClass.exec(strsql);
}
try
{
this.MainThread.Abort();
}
catch
{
}
if (this._curTask.Stu != "" && this.rw_chk_Addtp.Checked)
this.postTask(0);
loginForm.Close();
e.Cancel = false;
}
else
{
new usersClass().updateLoginUserStu(DateTime.Now.ToString("yyyy-MM-dd HH:mm"), sys.LoginUser.ID);
e.Cancel = true;
}
}