private void loadVersion() { ServerVersion sv = new ServerVersion(); string localVersion = Global.version; string serverVersion = sv.GetServerVersion(); int verCha = Convert.ToInt32(serverVersion.Replace(".", "")) - Convert.ToInt32(localVersion.Replace(".", "")); if (verCha > 0) { setLabel1Text("当前软件版本为 " + localVersion + " 版,软件有更新"); SetLinkLabel(); } else { setLabel1Text("当前软件版本为 " + localVersion + " 版,软件暂时无更新。"); } setLabel2Text("恩泽天下辅助运算软件一直以来秉承服务用户的原则,积极为公益事业尽心尽力。"); }
/// <summary> /// 查找软件是否有更新 /// </summary> private void findUpdate() { ServerVersion sv = new ServerVersion(); string localVersion = Global.version; string serverVersion = sv.GetServerVersion(); int verCha = Convert.ToInt32(serverVersion.Replace(".", "")) - Convert.ToInt32(localVersion.Replace(".", "")); if (verCha > 0) { MessageBoxButtons messButton = MessageBoxButtons.OKCancel; DialogResult dr = MessageBox.Show("软件有更新,需要更新吗?", "软件更新", messButton); if (dr == DialogResult.OK)//如果点击“确定”按钮 { openUpdateExe(); } } }