Is it possible in .NET to list files in a remote location, such as a URL?
You must indicate which protocol we are talking about.
For HTTP, lubos hasko provided the answer: no. HTTP has no concept of files; only resources. If you have control over the web server, you can ask it to provide a list of directories, or, even better, you can write the code that the server server displays for you. Without such control, you need to rely on the server to provide a listing that 1) can be disabled for security reasons, 2) not standardized in its format, 3), like lubos, will be fragile for analysis ( "scrape" ).
If you mean / if the server provides a protocol designed to transfer files such as FTP, SMB / CIFS, etc., it will be much easier. For example, for FTP, you want to see WebRequestMethods.Ftp.ListDirectoryDetails .
source share