/// <summary>
 /// 程序启动后,自动检测是否需要升级
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void timer_Update_Tick(object sender, EventArgs e)
 {
     UpdatePro.UpdateManager objUpdateManager = null;
     try
     {
         objUpdateManager = new UpdatePro.UpdateManager();//因为需要联网下载最新文件,有可能出错
     }
     catch (Exception ex)
     {
         MessageBox.Show("无法连接服务器,请检查网络设置!出错信息:" + ex.Message);
         return;
     }
     if (objUpdateManager.IsUpdate)
     {
         UpdatePro.FrmTips frmTips = new UpdatePro.FrmTips();
         frmTips.Show();
     }
     timer_Update.Enabled = false;//停止定时器,防止频繁弹窗
 }
 /// <summary>
 /// 升级入口按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void txmi_update_Click(object sender, EventArgs e)
 {
     UpdatePro.UpdateManager objUpdateManager = null;
     try
     {
         objUpdateManager = new UpdatePro.UpdateManager();//因为需要联网下载最新文件,有可能出错
     }
     catch (Exception ex)
     {
         MessageBox.Show("无法连接服务器,请检查网络设置!出错信息:" + ex.Message);
         return;
     }
     if (!objUpdateManager.IsUpdate)
     {
         MessageBox.Show("当前版本已是最新,不需要升级!", "更新提示:");
         return;
     }
     if (MessageBox.Show("为了更新文件,将退出当前程序,请确保数据已保存!确认退出吗?", "更新提示:", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
     {
         Application.Exit();
         System.Diagnostics.Process.Start("UpdatePro.exe");
     }
 }