0

Here I download a file from website which works good. But I wanted to download a Folder with contents.

Before Download Example

MyprojectApp/Test.exe

My Code

WebClient wc = new WebClient();
String Filename = "some.txt";
Uri uri = new Uri("http://127.0.0.1/New/" + Filename);
wc.DownloadFileAsync(uri, "some1.txt");

After Download Example(What I need)

MyprojectApp/Test.exe
MyprojectApp/New/some.txt
  • 1
    One thing to be aware of, *websites are not filesystems*. There's no such thing as a 'folder' in HTTP, just a URL with a resource. If you want a protocol that works like a remote file system, try FTP – Nick Bailey Aug 05 '22 at 19:16
  • Assuming the files are actually listed in one of those server-generated pages that lists folder contents then just use `wget`, see here: https://stackoverflow.com/questions/273743/using-wget-to-recursively-fetch-a-directory-with-arbitrary-files-in-it - **don't use WebClient in 2022**, it's a very old type with a a poorly designed interface and lacking modern functionality - if you have to use C# then use `HttpClient` instead. – Dai Aug 05 '22 at 20:06

0 Answers0