Using VS2005. I am attempting to copy the entire contents of a directory (well just the files right now - not folders). I can get all of the file paths by using "Directory.Getfiles()" and then looping through the elements.
My problem comes in when I attempt to copy them and I need to give a file name. I would like to use the same file name just in a different location but I don't know how to trim the old path.
Example:
I want to get "AUTHORS" out of "C:\Program Files\Ares\AUTHORS" (AUTHORS is the file name). Can someone tell me how to do this, or if there is another way to do this? Thanks.
My problem comes in when I attempt to copy them and I need to give a file name. I would like to use the same file name just in a different location but I don't know how to trim the old path.
Example:
I want to get "AUTHORS" out of "C:\Program Files\Ares\AUTHORS" (AUTHORS is the file name). Can someone tell me how to do this, or if there is another way to do this? Thanks.