|
-
Sep 24th, 2008, 03:29 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] [2005] Unable to copy directory
Hi!
I am very annoyed with a problem I have when trying to copy a directory.
In my application folder I have a structure like this
MyApp\Comp1\bin\Debug
MyApp\Comp1\Init
MyApp\Comp1\Data
MyApp\Comp1\Archive
MyApp\Comp2\bin\Debug
etc...
WHen someone drops a certain file in the Init directory I want first archive the entire Data directory to the Archive folder, creating a folder like:
Archive\Data_2008-09-27\
But the problem is, in order to do this I need to know the full path of the Data and archive folders. I tried to do this:
Application.StartupPath +"\..\..\Data"
But the the My.Computer.FileSystem.CopyDirectory method complains about a bad path. I assume it can't handle the \..\ Is there a better way to get the path only to the MyApp1\ level?
like c:\Apps\MyApps\MyApp1
Anyone has a solution to this? It should be simple... I just want to know the AppRoot path...
Note this is Winforms, not ASP.NET
And I dont want to do string parsing... feels sooo vb6
kind regards
Henrik
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|