Hello, how can I find a file(or set of files) in LAN via C# ?
c# and sharing
Collapse
This topic is closed.
X
X
-
Scherbina VladimirTags: None -
Scherbina Vladimir
Re: c# and sharing
"Chris Hornberger" <chris@chornbe. com> wrote in message
news:53ec8913.0 307281314.2ea4d 3f2@posting.goo gle.com...[color=blue]
> Use a typical recusive search algorythm on the uppermost UNC.
>
> like:
>
> string unc = @"\\server\shar e";
> 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.WriteLi ne( di.FullName );
>
> // then recurse the directories
> foreach( DirectoryInfo diSub in di.GetDirectori es() ){
> RecurseFolders( diSub );
> }
> }[/color]
thanks.
Comment