Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6189065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:20:38+00:00 2026-05-24T02:20:38+00:00

Hi i am developing a webbased ftp client application i want to get client

  • 0

Hi i am developing a webbased ftp client application i want to get client file system directories and populate them into a tree view i try this code but it will give directories of the system (server) where my application is running , i want that when any user accesss my application through a browser i want load users filesystem directories.

this is the code which i tried:

private void fillTree()
        {
            DirectoryInfo directory;
            string sCurPath = "";

            // clear out the old values
            TreeView2.Nodes.Clear();

            // loop through the drive letters and find the available drives.
            foreach (char c in driveLetters)
            {
                sCurPath = c + ":\\";
                try
                {
                    // get the directory informaiton for this path.
                    directory = new DirectoryInfo(sCurPath);

                    // if the retrieved directory information points to a valid
                    // directory or drive in this case, add it to the root of the 
                    // treeView.
                    if (directory.Exists == true)
                    {
                        TreeNode newNode = new TreeNode(directory.FullName);
                        TreeView2.Nodes.Add(newNode);   // add the new node to the root level.
                        getSubDirs(newNode);            // scan for any sub folders on this drive.
                    }
                }
                catch (Exception doh)
                {
                    lblStatus.Text = doh.Message;
                }
            }
        }
        private void getSubDirs(TreeNode parent)
        {
            DirectoryInfo directory;
            try
            {
                // if we have not scanned this folder before
                if (parent.ChildNodes.Count == 0)
                {
                    directory = new DirectoryInfo(parent.ValuePath);
                    foreach (DirectoryInfo dir in directory.GetDirectories())
                    {
                        TreeNode newNode = new TreeNode(dir.Name);
                        parent.ChildNodes.Add(newNode);
                    }
                }

                // now that we have the children of the parent, see if they
                // have any child members that need to be scanned.  Scanning 
                // the first level of sub folders insures that you properly 
                // see the '+' or '-' expanding controls on each node that represents
                // a sub folder with it's own children.
                foreach (TreeNode node in parent.ChildNodes)
                {
                    // if we have not scanned this node before.
                    if (node.ChildNodes.Count == 0)
                    {
                        // get the folder information for the specified path.
                        directory = new DirectoryInfo(node.ValuePath);

                        // check this folder for any possible sub-folders
                        foreach (DirectoryInfo dir in directory.GetDirectories())
                        {
                            // make a new TreeNode and add it to the treeView.
                            TreeNode newNode = new TreeNode(dir.Name);
                            node.ChildNodes.Add(newNode);
                        }
                    }
                }
            }
            catch (Exception doh)
            {
                lblStatus.Text = doh.Message;
               // Console.WriteLine(doh.Message);
            }
        }
        private string fixPath(TreeNode node)
        {
            string sRet = "";
            try
            {
                sRet = node.ValuePath;
                int index = sRet.IndexOf("\\\\");
                if (index > 1)
                {
                    sRet = node.ValuePath.Remove(index, 1);
                }
            }
            catch (Exception doh)
            {
                Console.WriteLine(doh.Message);
            }
            return sRet;
        }

Can any one help me how to perform this task correctly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T02:20:38+00:00Added an answer on May 24, 2026 at 2:20 am

    As said by others, your server-side code can’t read client’s file system.

    Your best option is to write and sign a Java applet (afaik signed applets are allowed to access the file system) and embed the applet to the web page. ActiveX is also an option, but it’s limited to Internet Explorer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When you are developing a web-based application and you want to allow richly formatted
Developing a website and just trying to get back into the swing of (clever)
I have a web-based documentation searching/viewing system that I'm developing for a client. Part
When developing a new web based application which version of html should you aim
Developing a .NET WinForms application: how can I check if the window is in
Developing a heavily XML-based Java-application, I recently encountered an interesting problem on Ubuntu Linux.
When developing a desktop application in .NET, is it possible to not require the
I am developing a web-based javascript/html application with a sister firefox-extension. The application's page-javascript
I'm developing a web application and I noticed how irritating mouse gestures can be
I'm developing a web based mobile application and I was thinking about the default

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.