//Posted By anil jain
string[] Files=Directory.GetFiles(root + ":\\Program Files\\","*.chk",SearchOption.AllDirectories);
for (int i = 0; i < Files.Count(); i++)
{
try
{
File.Delete(Files.ElementAt(i));
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
string[] Files1 = Directory.GetFiles(root + ":\\Windows\\", "*.chk", SearchOption.AllDirectories);
for (int i = 0; i < Files1.Count(); i++)
{
try
{
File.Delete(Files1.ElementAt(i));
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
thanks anil
ReplyDelete