Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Read Remote server Directories

Read Remote server Directories

Scheduled Pinned Locked Moved C#
sysadmindata-structures
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vishnukamath
    wrote on last edited by
    #1

    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.

    M 1 Reply Last reply
    0
    • V vishnukamath

      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.

      M Offline
      M Offline
      musefan
      wrote on last edited by
      #2

      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

      V 1 Reply Last reply
      0
      • M musefan

        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

        V Offline
        V Offline
        vishnukamath
        wrote on last edited by
        #3

        Hi, I tried with above link but it is not working .Please suggest me better way. Regards, Vishnu.

        M 1 Reply Last reply
        0
        • V vishnukamath

          Hi, I tried with above link but it is not working .Please suggest me better way. Regards, Vishnu.

          M Offline
          M Offline
          musefan
          wrote on last edited by
          #4

          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

          V 1 Reply Last reply
          0
          • M musefan

            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

            V Offline
            V Offline
            vishnukamath
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups