示例#1
0
 private void CheckAUpdateBt_Click(object sender, EventArgs e)
 {
     if (CheckAUpdateBt.Text == "立即更新")
     {
         check.ResumeSoftware();
         QuickForm.NewVersionExist = false;
     }
     else
     {
         CheckAUpdateBt.Text    = "正在检测更新...";
         CheckAUpdateBt.Enabled = false;
         new Thread(() =>
         {
             cheackLoading             = true;
             QuickForm.NewVersionExist = check.CheckVersion();
             NewVersion = QuickForm.NewVersionExist;
             if (NewVersion)
             {
                 BeginInvoke(new Action(() =>
                 {
                     UpdateLabel.Visible    = NewVersion;
                     CheckAUpdateBt.Enabled = true;
                     CheckAUpdateBt.Text    = NewVersion ? "立即更新" : "检测新版本";
                     webBrowser1.Navigate(@"C:\Program Files\菠萝工具箱\UpdateDetail.html");
                     cheackLoading = false;
                 }), null);
                 MessageBox.Show("当前存在新版本,请及时更新。");
             }
             else
             {
                 BeginInvoke(new Action(() =>
                 {
                     CheckAUpdateBt.Enabled = true;
                     CheckAUpdateBt.Text    = NewVersion ? "立即更新" : "检测新版本";
                     cheackLoading          = false;
                 }), null);
                 MessageBox.Show("当前已经是最新版本!");
             }
         }).Start();
     }
 }
示例#2
0
 private void button2_Click(object sender, EventArgs e)
 {
     update.ResumeSoftware();
 }