/// <summary>
/// 下载更新
/// </summary>
public void Update()
{
try
{
if (!isUpdate)
return;
WebClient wc = new WebClient();
string filename = "Update_NewVersion.zip";
filename = Path.GetDirectoryName(loadFile) + "\" + filename;//保存地址
FinalZipName = filename;//下载地址
wc.DownloadFileAsync(new Uri(download), filename);
wc.DownloadProgressChanged += new DownloadProgressChangedEventHandler(wc_DownloadProgressChanged);
wc.DownloadFileCompleted += new System.ComponentModel.AsyncCompletedEventHandler(wc_DownloadFileCompleted);
wc.Dispose();
}
catch(Exception ex)
{
throw new Exception("更新出现错误,网络连接失败);
}
}
代码执行可以成功,但是没有下载到zip文件,问题找了好久没找到原因,麻烦大神帮我看看问题出在哪里,我的下载地址放的是阿里云的oss zip文件地址。