How to import file of the www

J

Jon Skeet [C# MVP]

Mika M said:
How can I check that file exists in the internet, because for example the
following is NOT working ...

blnExist =
System.IO.File.Exists("http://www.suomenpankki.fi/ohi/fin/0_new/0.1_valuutta
k/fix-rec.txt")

No, and indeed it shouldn't. System.IO.File is about file system
objects, not web pages.
... and how do You recommend to import/update file of the net into DataSet
DataTable daily? Any examples available?

Download it using WebClient or WebRequest. If those give you a 404
(HttpStatusCode.NotFound) then that's the equivalent of the file not
existing.
 

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

Top