Question: I have one text box which accepts the path of selected folder. And i need to display all sub folders present in that folder in a TreeView.

How can i do this?

Answer: 
```
string Path = @"C:\Temp Folder\";
string[] folders = System.IO.Directory.GetDirectories(Path, "*", System.IO.SearchOption.TopDirectoryOnly); 

       TreeNode treeNode = new TreeNode(Path);          
        TreeNode subNode;
        for (int i = 0; i < folders.Length; i++)
        {
            subNode = new TreeNode(folders[i].ToString());
            treeNode.Nodes.Add(subNode);            
        }
        treeView1.Nodes.Add(treeNode);  

```
Following code will help u.

```
           DirectoryInfo parentInfo = new DirectoryInfo(@"path");
           DirectoryInfo[] childInfo= parentInfo.GetDirectories();
           treeView1.Nodes.Add(parentInfo.Name);
            foreach(DirectoryInfo di in childInfo)
            {
                treeView1.Nodes[0].Nodes.Add(di.Name);
            }

```