hi
i try to list all file of certain type from my c drive. but i run into the same problem every time
(Access to the path 'C:\$Recycle.Bin\S-1-5-18' is denied.)
how can i work around this problem.
my code is the following:
private void button1_Click(object sender, EventArgs e)
{
listView1.Items.Clear();
var files = Directory.EnumerateFiles(@"C:\", "*" + comboBox1.SelectedItem.ToString(), SearchOption.AllDirectories);
foreach (string file in files)
{
string filename = Path.GetFileNameWithoutExtension(file);
ListViewItem item = new ListViewItem(filename);
item.Tag = file;
listView1.Items.Add(item);
}
}