TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
kevin bredahl
NA
18
6.8k
search files = problems
May 18 2014 12:10 PM
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);
}
}
Reply
Answers (
8
)
export datagridview to xml
Export data from excell