foreach (DirectoryInfo di in dir.GetDirectories()) { ListViewItem item = new ListViewItem(); item.ImageIndex = 0; item.Text = di.Name; item.Tag = di.FullName; listView_Files.Items.Add(item); }
DirectoryInfo dir = new DirectoryInfo(""); foreach (DirectoryInfo di in dir.GetDirectories("*.*", SearchOption.AllDirectories) { }
DirectoryInfo di = new DirectoryInfo(@"C:\Windows"); DirectoryInfo[] _allDirectories = di.GetDirectori("*.*",SearchOption.AllDirectories) foreach (var item in _allDirectories) { ListViewItem item = new ListViewItem(); item.ImageIndex = 0; item.Text = di.Name; item.Tag = di.FullName; listView_Files.Items.Add(item); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)