다음 코드는 응용 프로그램 내부의 단추를 누르면 ZIP 보관함을 다운로드합니다. 파일이 거기에있는 것 같지만 열거 나 추출하려고하면 다음 오류 메시지가 나타납니다. Archive Unknown Format or Damaged
.ZIP 다운로드, 보관 알 수없는 형식 또는 손상됨
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.");
}
... "다음 코드"가 ... 어떤 점에서 따라야 할 것이라고 생각합니까? :) –
@SimonWhitehead 죄송합니다 그것을 추가하는 걸 잊었습니다 –
URL이 잘못되었습니다. 그게 문제 야. HTML 파일을 다운로드하고 .zip 확장자로 저장합니다. –