Tuesday, February 2, 2010

Get Recycle bin data from Windows 7 in C#.Net

//Posted by anil jain

if (sOsVersion.IndexOf("6.1.7") > 0) //Windows 7
{
for (int j = 0; j < sDriveLetter.Count(); j++)
{
string[] Files1 = Directory.GetFiles(sDriveLetter.ElementAt(j) + "$Recycle.Bin\\", "*", SearchOption.AllDirectories);
for (int i = 0; i < Files1.Count(); i++)
{
//File.Delete(Files1.ElementAt(i));
myList.Add(Files1.ElementAt(i));
}
}
}

No comments:

Post a Comment