There is this for listing files from ftp directory:
FtpWebRequest ftpRequest = (FtpWebRequest)WebRequest.Create(uri);
ftpRequest.Credentials =new NetworkCredential("username","pword");
ftpRequest.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
FtpWebResponse response = (FtpWebResponse)ftpRequest.GetResponse();
StreamReader streamReader = new StreamReader(response.GetResponseStream());
string line = streamReader.ReadLine();
while (!string.IsNullOrEmpty(line))
{
// if file is .txt, read file content
}
But how do I read the content of the file? Not just the listing here?
(I would prefer now having to download them first) Thanks.