grab file from url location

  • Thread starter Thread starter Mark Broadbent
  • Start date Start date
M

Mark Broadbent

I'm sure this must be extremely easy. What I want to do is to grab a text
file that is republished on the internet daily, and save this to disk. Can
someone point me to a class that I can use to do this? For the latter part I
presume I'd need to use a Filestream object to save this file.
 
Hi Mark,

Don't worry, it is extremely easy.
You use a webclient for file download.

using System.Web;

WebClient client = new WebClient();
client.DownloadFile("http://www.somesite.com/info.txt", "c:\\info.txt");

Happy coding!
Morten
 
Oh yeah, as Dmitriy pointed out, it's System.Net, not System.Web
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top