更新提示

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

    }
posted @ 2020-09-23 22:24  zhujie-  阅读(136)  评论(0编辑  收藏  举报