Esempio n. 1
0
 private void UpdateProcess_Load(object sender, EventArgs e)
 {
     try
     {
         updater = new UpdateClass();
         updater.ActivationCompleted += new EventHandler<ActivationCompletedEventArgs>(ActivationCompleted);
         updater.ActivationError += new EventHandler<FileCopyErrorEventArgs>(ActivationError);
         updater.ActivationInitializing += new EventHandler<ManifestEventArgs>(ActivationInitializing);
         updater.ActivationProgressChanged += new EventHandler<FileCopyProgressChangedEventArgs>(ActivationProgressChanged);
         updater.ActivationStarted += new EventHandler<ActivationStartedEventArgs>(ActivationStarted);
         updater.DownloadCompleted += new EventHandler<DownloadCompleteEventArgs>(DownloadCompleted);
         updater.DownloadError += new EventHandler<DownloadErrorEventArgs>(DownloadError);
         updater.DownloadProgressChanged += new EventHandler<DownloadProgressEventArgs>(DownloadProgressChanged);
         InitUpdater();
     }
     catch (Exception ex)
     {
         Log.Write("更新错误:" + ex.Message);
         MessageBox.Show("请检查网络连接是否正常,客户端更新失败!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Esempio n. 2
0
 private void backgroundUpdate_DoWork(object sender, DoWorkEventArgs e)
 {
     UpdateClass updater = new UpdateClass();
     var list = updater.CheckForUpdates();
     e.Result = list.Length > 0;
 }