我对“.zip”文件下载有问题。我想制作一个游戏启动器,我需要添加游戏下载和安装功能。当我下载打包的游戏时
ZipFile.DownloadFile
它从服务器上损坏。
代码如下:
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net;
// Installation folder will be set in the folder browse dialog
string installationFolder;
// I don't want to show the download url but its in Mediafire
// and I tried to download it from Google Drive
string remoteUri = "the .zip file url";
string fileName = "gamename.zip", myStringWebResource = null;
// Create a new WebClient instance.
WebClient myWebClient = new WebClient();
// Concatenate the domain with the Web resource filename.
myStringWebResource = remoteUri + fileName;
// Download the Web resource and save it into the current filesystem folder.
myWebClient.DownloadFile(remoteUri, Application.StartupPath + "/gamesdownload/" + fileName);
ZipFile.ExtractToDirectory(Application.StartupPath + "/gamesdownload/gamename.zip", installationFolder);
代码有什么问题?