Hi,
Sorry to respectable sir/mam because i put my last question absolutely in wrong manner now i am going to mention some details
i write the following code for the file searching in my anti virus and it give exception when it scan "system volume information " folder
please help me by editing this code that it also give me the list of all files in "system volume information" folder
code is:
I am using c# language
***********************************************************************
DriveInfo[] drives = DriveInfo.GetDrives();
foreach (DriveInfo drive in drives)
{
comboBox2.Items.Add(drive.Name);
if (drive.DriveType.ToString() == "Fixed")
{
try
{
string[] dirs =
Directory.GetDirectories(drive.Name,"*.*",SearchOption.AllDirectories);
comboBox1.Items.Add(dirs.Length);
foreach (string dir in dirs)
{
comboBox1.Items.Add(dir);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}
*********************************************************************** The exception i am getting is as fellow i just mention below:
"System.UnauthorizedAccessException:Access to the path 'c:\System Volume Information'is denied.at system.IO.__Error.winIoeRROR(Int32 errorCode,string maybeFullpath)
at system.IO.InternalGetFileDirectioryName(string path,string userpathoriginal,string searchpattern,booleanincludeFiles,boolean includeDirs,Searchopyion searchoption)
at system.IO.Directiory.GetDirectories(string path,string searchpattern,searchoption searchoption)
at Antivirius.Form1.Form1_load)object Sender,EventArgs e)in D:\Documents and Settings\Shafiq Ur Rehman\My Documents\Visual Studio 2008\projects\Antivirius\Antivirius\Form1.cs:line34 "