DownloadFile

  • Thread starter Thread starter Mike Lincoln
  • Start date Start date
M

Mike Lincoln

I am trying to write a program to download files from the Internet, I know
using
webClient.Downloadfile(RemoteDir + remoteFileName, LocalFileName) can
download a singles file,
my question is, if we know a remote Dir, can we find all files in that dir?
(like Directory.Getfiles(Dir))
that way we can download all files in that directory.

Thank you very much.

Mike
 
Hi Mike,

From the Pentagon?

For that is FTP.

But only for FTP sites of course.

I know it helps not much, but if you find it, there are more intrested in
that.

Cor
 
Mike Lincoln said:
I am trying to write a program to download files from the Internet, I know
using
webClient.Downloadfile(RemoteDir + remoteFileName, LocalFileName) can
download a singles file,
my question is, if we know a remote Dir, can we find all files in that dir?
(like Directory.Getfiles(Dir))
that way we can download all files in that directory.

It depends on which protocol you will use. What protocol are you planning to
use?
 
Mike Lincoln said:
Thank you guys for replying.

I am using HTTP protocal.

You can use WebClient thats built into .net, or you can use Indy:
http://www.indyproject.org/indy.html

Indy support many more options than WebClient does.

And don't worry - its not commercial, its open source and free.
For example, I want to download all pictures from http://localhost/Images/,
what should I do?

Well thats kind of a problem. SOME webservers will give you a directory
listing, some wont. If they do you have to go through the HTML and pluck out
the URLs and request for each one.
 
Back
Top