Author: WilliamSnell | Posted on: 9/30/2009 10:27:55 AM | Views : 327

I have an FTP polling/download application I've created, and I have it successfully getting a list of files from a server and downloading those files. There are a couple areas of strange behavior that are the source of other threads, but here's a new one. When I fetch the directory details, how do I determine (besides using string parsing) whether a line returned is a file or a folder? Also, is there a way to limit the attributes sent along with the details? Here's a snippet of the code:
private List<string> GetDirectoryListing(string folderPath) { List<string> fileList = new List<string>(); StringBuilder sbResults = new StringBuilder(); FtpWebRequest request; try { request = (FtpWebRequest)FtpWebRequest.Create(new Uri(FtpServerURL)); request.UseBinary = true; request.Credentials = new Network ...

Go to the complete details ...