Download file using webclient

Posted by user79127 on Stack Overflow See other posts from Stack Overflow or by user79127
Published on 2010-06-11T15:43:56Z Indexed on 2010/06/11 15:52 UTC
Read the original article Hit count: 671

Filed under:
|
|

I try to download a file from https site and every time the file is saved to my machine it is only 1KB. The file is supposed to be 1MB. I am using Webclient.

string strFile = @"c:\myfile.txt";
WebClient wc = new WebClient();
wc.Credentials = new System.Net.NetworkCredential("userid", "pw");
wc.DownloadFile("https://www.mysite.come/myfile.txt", strFile);

Do I miss anything?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about webclient