当按下应用程序内的按钮时,以下代码会下载 ZIP 存档。该文件似乎在那里,但是当我尝试打开它或提取它时,我收到以下错误消息:Archive Unknown Format or Damaged
.
private void Button_Click_1(object sender, RoutedEventArgs e)
{
string url = @"http://dc659.4shared.com/download/eRPYQvPM/Medieval_Silver_for_PC.zip?tsid=20130403-023918-42de479a";
// Create an instance of WebClient
System.Net.WebClient client = new System.Net.WebClient();
// Hookup DownloadFileCompleted Event
client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted);
// Start the download and copy the file to c:\temp
client.DownloadFileAsync(new Uri(url),
@"Extract.zip");
}
void client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
{
MessageBox.Show("Thank you for downloading! To play extract the ZIP folder.");
}