This is my code:
private static void GetAllFilesFrom(string path, string extension)
{
try
{
if ((File.GetAttributes(path) & FileAttributes.ReparsePoint) != FileAttributes.ReparsePoint)
{
foreach (string folder in Directory.GetDirectories(path))
{
foreach (string file in Directory.GetFiles(folder, extension))
{
Console.WriteLine(file);
}
GetAllFilesFrom(folder, extension);
}
}
}
catch (UnauthorizedAccessException) { }
}
Sanjeeb LenkaPosted Jun 29, 2013, 5:29 AM
private static void GetAllFilesFrom(string path, string extension)
{
try
{
List
if ((File.GetAttributes(path) & FileAttributes.ReparsePoint) != FileAttributes.ReparsePoint)
{
foreach (string folder in Directory.GetDirectories(path))
{
foreach (string file in Directory.GetFiles(folder, extension))
{
list.Add(file);
}
GetAllFilesFrom(folder, extension);
}
}
}
catch (UnauthorizedAccessException) { }
}