c# and sharing

  • Thread starter Thread starter Scherbina Vladimir
  • Start date Start date
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 );
}
}

thanks.
 
Back
Top