how can i get a list of folders from a website? Namely I wrote a program that take a URL And give a list of folders from the website.
but it not work.
Considering very few websties ever give you browse access to their file system, you're going to have a hard time finding a website that this tool will work with.
The Directory class only works with local file systems. It will not work over HTTP, meaning you can't use it for getting the list of directories on a website.
You would have to use the HttpWebRequest class with web URLs and parse the result you get back, if any.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)