C++ .NET을 통해 rapidshare에서 파일을 다운로드하려고하는데 문제가 있습니다.Managed C++ 또는 C# .NET, rapidshare에서 다운로드 하시겠습니까?
주소가 "https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi"이었지만 더 이상 작동하지 않는 주소는 누구나 새로운 주소를 알고 있습니까? 코드는 작동하지만 파일 크기는 항상 1KB입니다. 올바른 서버에 연결할 필요가 없습니다.
private: void downloadFileAsync(String^ fileUrl)
{
String^ uriString;
uriString = "https://ssl.rapidshare.com/premzone.html";//"https://ssl.rapidshare.com";
NameValueCollection^ postvals = gcnew NameValueCollection();
postvals->Add("login", "bob");
postvals->Add("password", "12345");
// postvals->Add("uselandingpage", "1");
WebClient^ myWebClient = gcnew WebClient();
array<unsigned char>^ responseArray = gcnew array<unsigned char>(10024);
responseArray = myWebClient->UploadValues(uriString, "POST", postvals);
StreamReader^ strRdr = gcnew StreamReader(gcnew MemoryStream(responseArray));
String^ cookiestr = myWebClient->ResponseHeaders->Get("Set-Cookie");
myWebClient->Headers->Add("Cookie", cookiestr);
//myWebClient->DownloadFileCompleted += gcnew AsyncCompletedEventHandler(myWebClient->DownloadFileCompleted);
myWebClient->DownloadFileAsync(gcnew Uri(fileUrl),"C:\\rapid\\"+Path::GetFileName(fileUrl));
}
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
{
downloadFileAsync("http://rapidshare.com/files/440636806/ArcadeBackground.png");
}
1kB 파일의 내용은 무엇입니까? – CodesInChaos
이 언어는 C++/CLI가 아니고 C++ .NET이 아니며 확실히 "Managed C++"가 아닙니다. 마지막 용어는 VS2002 및 VS2003의 일부인 "Managed Extensions for C++"의 약자로만 사용되며 VS2005에서 C++/CLI가 나올 때 사망했습니다. –