S
Scherbina Vladimir
Hello, how can I find a file(or set of files) in LAN via C# ?
Chris Hornberger said:Use a typical recusive search algorythm on the uppermost UNC.
like:
string unc = @"\\server\share";
RecurseFolders( new DirectoryInfo( unc ) );
private static void RecurseFolders( DirectoryInfo di ){
// check here for your file(s)
// break; or use a class level flag to halt if found
Console.WriteLine( di.FullName );
// then recurse the directories
foreach( DirectoryInfo diSub in di.GetDirectories() ){
RecurseFolders( diSub );
}
}