Hi,
I am writing a program for finding all the files in the computer but there is a unknown problem.This code is not showing me all the files.
I am posting code please help me
try
{
// Loop through the list of directories.
foreach (string strDirName in Directory.GetDirectories(strDir))
{
// Display the directory name.
//Console.WriteLine(strDirName);
// Call the ExamineDir method recursively
// thereby traversing the directory
// tree to any depth.
foreach (string strFileName in Directory.GetFiles(strDirName))
{
FileInfo myfile = new FileInfo(strFileName);
if (myfile.Length <= 3000)//detemine scanner file size
{
statusTxt.Text = strFileName;
statusTxt.Refresh();
Application.DoEvents();
checksum c = new checksum();
string value = c.calculator(strFileName);
defmatcher m = new defmatcher();
string matched = m.go(value);
if (matched != null)
MessageBox.Show(matched);
// MessageBox.Show(value);
}
}//2foreach end
}
//////////////////////////////////////////////////////////////////////////
private void button1_Click(object sender, EventArgs e)
{
/////////////////////////////////////////////
DriveInfo[] drives = DriveInfo.GetDrives();
foreach (DriveInfo drive in drives)
{
if (drive.DriveType.ToString() == "Fixed")
{
ExamineDir(drive.Name);
}
}
}
////////////////////////////////////////////////////////////////////////////////