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
Mohan kadam
NA
21
20.5k
how to delete specific file in directroy folder.
Nov 30 2013 2:34 AM
i want to delete only selected file in datagridview. now all files can be deleted from directroy folder.so plz give me good answer.
here is my code,
foreach (DataGridViewRow dr in datagridscanedfiles.Rows)
{
for (int i = datagridscanedfiles.Rows.Count - 1; i >= 0; i--)
{
if ((bool)datagridscanedfiles.Rows[0].Cells[0].Value)
{
DirectoryInfo directoryInfo = new DirectoryInfo(@"D:\mohan\MACRO WINDOWS\MACRO WINDOWS\MACRO WINDOWS\Scan\");
foreach (var file in directoryInfo.GetFiles("*.*", SearchOption.AllDirectories))
{
FileInfo file=new FileInfo (@"D:\mohan\MACRO WINDOWS\MACRO WINDOWS\MACRO WINDOWS\Scan\");
file.Delete();
}
scanfile.Clear();
datagridscanedfiles.Rows.RemoveAt(i);
picboxscan.Image = null;
}
}
Reply
Answers (
1
)
how to enable disable radiobuttons based on calculation?
web form model