Exemple #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            m_curPath   = "Root";
            label1.Text = m_curPath;

            TreeNode root = treeView1.Nodes.Add(m_curPath);

            string[] drives = Directory.GetLogicalDrives();

            foreach (string drive in drives)
            {
                DriveInfo di = new DriveInfo(drive);

                if (di.IsReady)
                {
                    TreeNode node = root.Nodes.Add(drive);
                    node.Nodes.Add("\\");
                }
            }
        }
Exemple #2
0
 string [] getLogicalDrives()
 {
     return(Directory.GetLogicalDrives());
 }
Exemple #3
0
 public string[] getDiskPath()
 {
     string[] diskNames = Directory.GetLogicalDrives();
     return(diskNames);
 }