Read Remote server Directories
-
Hi, I need to read Remote server Directories through FTP Credentials and bind remote directory structure to Tree View Control. Please suggest me better way. Regards, Vishnu.
-
Hi, I need to read Remote server Directories through FTP Credentials and bind remote directory structure to Tree View Control. Please suggest me better way. Regards, Vishnu.
-
Use FTPWebRequest[^] class. You can get the directory list from here and create your treeview based on that
I may or may not be responsible for my own actions
Hi, I tried with above link but it is not working .Please suggest me better way. Regards, Vishnu.
-
Hi, I tried with above link but it is not working .Please suggest me better way. Regards, Vishnu.
-
What is not working... show some code. If it is not working, then a better way would be to make it work
I may or may not be responsible for my own actions
Hi, I tried with below code and i'm getting only root directories not sub directories , i need to get sub directories please suggest me better way. string ftpServerIP = "75.125.2.193"; FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://" + ftpServerIP + "/"); request.Method = WebRequestMethods.Ftp.ListDirectoryDetails; request.Credentials = new NetworkCredential("barikgr2", "barik122"); FtpWebResponse response = (FtpWebResponse)request.GetResponse(); Stream responseStream = response.GetResponseStream(); StreamReader reader = new StreamReader(responseStream); string line; while ((line = reader.ReadLine()) != null) { TreeNode node = new TreeNode(); string[] _arv = line.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries); node.Text = _arv[3]; treeView1.Nodes.Add(node); } reader.Close(); response.Close(); Regards, Vishnu.