I need help to map my drive to tree view I can get to show my drive, But I can not find all the sub directories I want to map my entire drive to a tree view. Any help would be appreciated. This is what I have so far received.
string [] drive = environment Gastological Diseases (); FORECHA (string in the drive D) {treeNode = new triode (DR); Node Tag = Dr; TreeView1.Nodes.Add (node); } TreeView1.CollapseAll ();
Here's a lazy loading version:
Private Zero fillTree () {string [] drive = environment. Gastological Diseases (); FORECHA (string in the drive D) {treeNode = new triode (DR); Node Tag = Dr; Node Image index = 0; // drive icon node. Tag = Dr; TreeView1.Nodes.Add (node); Node Nodes. Add (new treeoid ("?")); } TreeView1.BeforeExpand + = New TreeViewAventHandler (tree view 1_BeforeExpand); } Void treeView1_BeforeExpand (object sender, tree vivankel event ARG E) {if ((e.Node.Nodes.Count == 1) & amp; (E. node. Nodes [0]. Text == "?")) { Recursive dirvac (e.Node); }} Private TreeNode Recursive DiaryWalk (tree node node) {string path = (string) node. Tag; Node.Nodes.Clear (); String [] dirs = System.IO.Directory.GetDirectories (path); (Ent T = 0; T & LT; Dias. Langti; T ++) {TreeNode N = New Treeode (DIRS) [S] Abstraction (DIRS [T]. LIDXF ('\\') + 1) ; N.IgeEndex = 1; // DIR icon NTAP = Ders [T]; Node.Nodes.Add (n); N.Nodes.Add (new triode ("?")); } // Optional if you also want the file: string [] files = System.IO.Directory.GetFiles (path); (Int t = 0; t & lt; files.Length; t ++) {TreeNode TN = New Treeode (System.IO.Path.GetFileName (files [T])); Tn.Tag = files [T]; Tn.ImageIndex = 2; // file icon node. Node.ed (tn); } // Optional file part end of the return node; }
Comments
Post a Comment