0% found this document useful (0 votes)
12 views

Namespace Public Partial Class Public: Explorer - Interface (: (Form1 (Initializecomponent )

The document contains code for a C# Windows Forms application that displays drives and directories in a tree view and files in a list view. The Form1 class loads drives and directories on form load but the methods are commented out.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Namespace Public Partial Class Public: Explorer - Interface (: (Form1 (Initializecomponent )

The document contains code for a C# Windows Forms application that displays drives and directories in a tree view and files in a list view. The Form1 class loads drives and directories on form load but the methods are commented out.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

namespace explorer_Interface

{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

// private void listView1_SelectedIndexChanged(object sender, EventArgs e)


//{

//}

private void Form1_Load(object sender, EventArgs e)


{
// this.treeView1.Nodes.Clear();
// this.listView1.Items.Clear();
this.label1.Text = "Path: ";
// LoadDrives();
}
//private void LoadDrives()
//{
// DriveInfo[] drives = DriveInfo.GetDrives();
// foreach (var drive in drives)
// {
// if (drive.IsReady)
// {
// // TreeNode trenode = this.treeView1.Nodes.Add(drive.Name);

// DirectoryInfo[] dirs = new


DirectoryInfo(drive.Name).GetDirectories();
// foreach (var dir in dirs) {
// // trenode.Nodes.Add(drive.Name);
// }
// }
// }
//}

// private void treeView1_NodeMouseClick(object sender, TreeViewEventArgs e)


//{
// string path=e.Node.FullPath + @"\" ;
// this.label1.Text=string.Format("Path: {0}",path);
// FileInfo[] files=new DirectoryInfo(path).GetFiles();
// foreach (var file in files) {
// ListViewItem item = this.listView1.Items.Add(file.Name);
// }

}
// }
}

You might also like