Thursday, April 3, 2008

Guinea Pig Hair Loss Mites

Dot Net (C #): SearchOption.AllDirectories for GetDirectories ()

The method GetDirectories () DirectoryInfo class provides all a search pattern matching directories. In this, the call
 dir.GetDirectories ( "Release *" ) 

example, all directories that begin with "Release . To do this for all subdirectories recursively programmed to not have to, it is possible that GetDirectoties () method by adding another parameter to feed:

 dir.GetDirectories ( "Release *" , SearchOption.AllDirectories) 

This call will be automatically searches all subdirectories. This saves you the recursive call methods, which makes the code much shorter.

It's the same with the method GetFiles () .

0 comments:

Post a Comment