I'm working on a project where I have to programmatically move files from one set of directories to another. Sounds easy, but I'm a bit confused about which object I need to use to get the file information I need to perform this. The directory structures look like this:
Based on information in an Oracle table, I know what the source folder names are and I can determine what the destination folder names will be. I do NOT have the file names! I need to find the name of the report file in each source folder (there will always be only one per folder...the original software wasn't designed very efficiently!) and move it to the predetermined folder on the other server (which will already exist - I've got that piece figured out!)
After looking through the Help and the dearth of info on MS'.NET developers' site, I'm confused over which object to use - Directory or DirectoryInfo - and how to go about get the information about the files so that I can move them to the correct places.
Does anyone have any information that would help me out on this? Thanks!
-Dell
A computer only does what you actually told it to do - not what you thought you told it to do.
Code:
[b]Source Directory[/b]
\\Server1\Archived Reports
Folder A (random name)
report A.rpt (random name)
Folder B
report B
etc...
[b]Destination Directory[/b]
\\Server2\Archived Report
Folder 1 (category of report)
report A.rpt (same random name...)
report B.rpt
Folder 2
report C.rpt
etc...
After looking through the Help and the dearth of info on MS'.NET developers' site, I'm confused over which object to use - Directory or DirectoryInfo - and how to go about get the information about the files so that I can move them to the correct places.
Does anyone have any information that would help me out on this? Thanks!
-Dell
A computer only does what you actually told it to do - not what you thought you told it to do.