Download File From Website

Hello,

I need to download a file from a website into my Windows Form Application. For example the file is http://mysite.com/thefile.txt

I just need to know what I should be using to access a file over the Internet.

I'd like to save the file into a String or a local file. But I think I can handle this part.

Thanks in advance!
LVL 8
YoungBonziAsked:
Who is Participating?
 
PashaModConnect With a Mentor Commented:
Closed, 125 points refunded.
PashaMod
Community Support Moderator
0
 
YoungBonziAuthor Commented:
Thanks Mahesh, but I'm very confused by those examples. Isn't there something in the .NET 2/3 framework to handle this?
0
 
YoungBonziAuthor Commented:
I found a solution...

WebClient^ myWebClient = gcnew WebClient;
Stream^ myStream = myWebClient->OpenRead( "http://www.asite.com/afile.txt" );

I can then manipulate myStream to do what I need.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.