public void processDir(string sourceDir, string searchForText, string replaceWithText)
{
// Process the list of files found in the directory.
string[] fileEntries = Directory.GetFiles(sourceDir);
foreach (string fileName in fileEntries)
{
// do something with fileName
Console.WriteLine(fileName);
}
// Recurse into subdirectories of this directory.
string[] subdirEntries = Directory.GetDirectories(sourceDir);
foreach (string subdir in subdirEntries)
// Do not iterate through reparse points
if ((File.GetAttributes(subdir) &
FileAttributes.ReparsePoint) !=
FileAttributes.ReparsePoint)
{
processDir(subdir, searchForText, replaceWithText);//recursive function
recursionLvl += 1;
Console.write ("Changing at deepness level : " + recursionLvl.ToString() + "\n");
}
No comments:
Post a Comment