Hello,
in C#, you must escape the backslash.
either use
Directory.GetDirectories(@"\\crpapp01\mastershare" , @"*",
SearchOption.AllDirectories))
or
Directory.GetDirectories("\\\\crpapp01\\mastershar e", @"*",
SearchOption.AllDirectories))
Best regards,
Henning Krause
"Curious" <fi********@yahoo.comwrote in message
news:11*********************@p77g2000hsh.googlegro ups.com...
There's a problem - I used UNC path (\\crpapp01\\mastershare") as root
folder and got an error: Cannot find "C:\crpapp01\\mastershare"
I used UNC path while it seems to interprete it as local folder. Any
work-around?
Details-----------------------------------------------------------------------
foreach (string dir in Directory.GetDirectories("\\crpapp01\
\mastershare", @"*", SearchOption.AllDirectories))
{
if (Directory.GetFiles(dir).Length == 0)
{
// Folder empty
//Console.WriteLine (dir);
sw.WriteLine(dir + "\n");
}
}