After a lot of testing etc, i decided to move away from the 3rd party FTP classes and use the standard Microsoft FtpWebRequest for faster speeds etc...
What i want to do is list the directories in a treeview!
Now here's my code :
try
{
FTPRequest = (FtpWebRequest)WebRequest.Create("ftp://iwantstringsman");
FTPRequest.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
FTPRequest.Credentials = new NetworkCredential(txtftpUserName.Text, txtftpPassword.Text);
FtpWebResponse FTPResponse = (FtpWebResponse)FTPRequest.GetResponse();
Stream FTPResponseStream = FTPResponse.GetResponseStream();
StreamReader reader = new StreamReader(FTPResponseStream);
Console.WriteLine(reader.ReadToEnd());
Console.WriteLine("Directory List Complete, status {0}");
foreach (char S in reader.ReadToEnd())
{
/* Making parent node */
TreeNode ParentNode = new TreeNode();
ParentNode.Text = S.ToString(); ;
treeView1.Nodes.Add(ParentNode);
}
reader.Close();
FTPResponseStream.Close();
}
catch (Exception EX)
{
MessageBox.Show(EX.Message);
}
Problem is this (the reader.ReadToEnd() only supports Characters)
how can i get this in string format ???
Regards...
Thanks in advance