private void timer1_Tick(object sender, EventArgs e)
{
x++;
if (x == 10)
{
string sql = "SELECT New_Version FROM VersionNumber";
string str = Convert.ToString(SqlHelper.SqlHelper.GetOneResult(sql));
if (str != ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString())
{
label1.Text = "发现新的版本,请重启程序进行更新";
label1.ForeColor = Color.Red;
}
else
{
label1.Text = "没有新的版本";
label1.ForeColor = Color.Black;
}
x = 0;
}
}