Link to home
Start Free TrialLog in
Avatar of Robb Hill
Robb HillFlag for United States of America

asked on

.net finding folders and subfolders

I am trying to do the following:

I have a winform.  

The winform will have 3 text boxes.

txt1   = server root   example " \\fraks\doc"   or  "\\Happy\doc"
txt2   = Parent folder   example  "Software Files"
txt3   = child folder  example "word documents"

I need some .net code that does the following:

Keep in mind I will be moving files...and this code is to determine the destination.
So starting from the server root I would need to look for the parent/child folder.
If the parent/child doesnt exist, does the child exist....and if neither exists...then I would want the destination to equal whatever that next level path up would be.  

Starting at the lowest level once it finds a match that will be the folder destination that I will be moving files too.


Also what IO operations should I include to make sure file integrity checks are in place.


So to restate...does this child folder exist in root...if so then it equals destination path.
Else does the parent folder exists without the child...if so then the parent equals the destination path.
If neither exists the files would be placed in the root above that parent folder.
ASKER CERTIFIED SOLUTION
Avatar of Robberbaron (robr)
Robberbaron (robr)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Robb Hill

ASKER

I am moving these files.

So how would you handle that.


I would want them to move the files..
Log me some information if it could not move the file.
and also log a list of contents in the folder that were never moved.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks so much