Search for a folder thru VB.NET

Ananda

Member
Joined
May 4, 2004
Messages
13
Hi

Can any one tell me how can i search for a folder thru VB.NET? For e.g search for the folder temp in all the logical drives and return the path.

Thanks & Regards
Ananda
 
In my idea... unless theres a component to do that... the only way is through recursive methods.

make a function that return a string. Look for folders in the starting folder and recall the same function with each sub-folder until you found your folder or that GetDirectories return no folder.

Youll have to make the algorithm ;)
Make sure to have a stop condition... because youll get a stack overflow if you do a infinite loop.
 
Ananda said:
Hi

Can any one tell me how can i search for a folder thru VB.NET? For e.g search for the folder temp in all the logical drives and return the path.

Thanks & Regards
Ananda

I have the code to do it in VB6 if you want it.

Could send you in the right direction

Also, look in the very powerful IO.File methods
 
Back
Top