Ejemplo n.º 1
0
 /// <summary>
 /// 异步检查开始
 /// </summary>
 protected virtual void ClientCheckAsync()
 {
     this.DisposeAvaliables();
     HostConfig.RefreshVersion();
     if (!System.IO.File.Exists(HostConfig.ExecutablePath))
     {
         this.OnError(new ErrorEventArgs("要更新的程序不存在。"));
         return;
     }
     if (!System.IO.File.Exists(HostConfig.ExecutableConfigPath))
     {
         this.OnError(new ErrorEventArgs("要更新的程序的配置文件不存在。"));
         return;
     }
     if (HostConfig.UpdateUrl == null)
     {
         this.OnError(new ErrorEventArgs("没有配置更新地址。"));
         return;
     }
     this.OnNotify(new NotifyEventArgs("正在下载更新信息。"));
     this.OnCheckStarted(new CheckStartedEventArgs());
     this.m_Client.DownloadStringAsync(new Uri(HostConfig.UpdateUrl + PACKAGES));
 }