62,272
社区成员
发帖
与我相关
我的任务
分享private void VersionUpdate_Shown(object sender, EventArgs e)
{
WebClient myclient = new WebClient();
MessageBox.Show("发现新版本,请选择下载路径!");
FolderBrowserDialog path = new FolderBrowserDialog();
path.ShowDialog();
String strDir = path.SelectedPath;
String strFileName= System.IO.Path.GetFileName(strUpdateUrl);
md = new MultiDownload(5, strUpdateUrl, strDir + "\\" + strFileName);
t.Start();
md.Start();
t.Elapsed += new System.Timers.ElapsedEventHandler(DownLoadComplete);
}
public void DownLoadComplete(object sender, System.Timers.ElapsedEventArgs e)
{
if (md.IsComplete && IsGoon)
{
IsGoon = false;
MessageBox.Show("最新安装包已经下载完成。");
}
if (!IsGoon)
{
t.Stop();
t.Dispose();
this.Close();
}
}