Exemple #1
0
 private void ExeMain()
 {
     GeneralCommon.Gp_LogTxt("Download Start00");
     if (MainMenu_Check())
     {
         Label1.Visible = true;
         Label1.Text    = "已打开过检验室程序";
         this.Refresh();
         if (MessageBox.Show("检验室程序正在运行,是否要关闭?关闭前请保存当前操作,以免丢失数据。", "更新提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
         {
             Process[] myProcess = null;
             myProcess = Process.GetProcessesByName(ProcessesName);
             foreach (Process myPro in myProcess)
             {
                 myPro.Kill();
             }
         }
     }
     if (UpdateInfo(GetFileInfo()) == true)
     {
         GeneralCommon.Gp_LogTxt("Download DownLoad_File00");
         DownLoad_File(GetFileInfo());
     }
     else
     {
         Label1.Visible = true;
         Label1.Text    = "程序已经是最新版本,无须更新";
         this.Refresh();
     }
     GeneralCommon.Gp_LogTxt("Download Process.Start00");
     Process.Start(sExePath + ProcessesName + ".exe");
     this.Dispose();
 }
Exemple #2
0
        private void DownLoadMain_Load(object sender, System.EventArgs e)
        {
            try
            {
                GeneralCommon.Gp_LogTxt("DownLoad DownLoadMain_Load 00");
                sExePath        = System.IO.Directory.GetCurrentDirectory() + "\\";
                this.KeyPreview = true;
                GeneralCommon.Gp_FormCenter(this);

                // Sets the timer interval to 5 seconds.
                Timer_Conut.Interval = 1000;
                Timer_Conut.Start();
            }
            catch (Exception ex)
            {
                GeneralCommon.Gp_LogData("DownLoadMain_Load " + ex.Message);
            }
        }