Пример #1
0
 void getDirs(string dir, TreeNode n)
 {
     string[] dirs = vol.GetDirectories(dir);
     //string[] files = vol.GetFiles(dir);
     foreach (string s in dirs)
     {
         TreeNode nn = new TreeNode(s, 1, 1);
         FileInfo fi = new FileInfo();
         fi.FileName = s;
         fi.FullPath = dir + "\\" + s;
         fi.TreeNode = nn;
         nn.Tag      = fi;
         n.Nodes.Add(nn);
         getDirs(dir + "\\" + s, nn);
     }
     //foreach (string s in files)
     //{
     //TreeNode nn = new TreeNode(s, 0, 0);
     //FileInfo fi = new FileInfo();
     //fi.FileName = s;
     //fi.FullPath = dir + "\\" + s;
     //fi.TreeNode = nn;
     //nn.Tag = fi;
     //n.Nodes.Add(nn);
     //}
 }