View Poll Results: Is this a dumb Question?
- Voters
- 2. You may not vote on this poll
-
There's no such thing as a dumb question!
-
Was this suposed to present a challenge?
-
Is this kid an idiot?
-
What's copying a file mean?
-
Mar 21st, 2004, 01:01 PM
#1
Thread Starter
New Member
How can I copy a file to a new location?
Hello, could someone please help me out with this, I'm at a dead hault with coding my program because I can't figure out how to copy a file to a new location.
All I want to do is select a file then rename it and copy it to a new location or directory on my PC. Any help would be greatly appreciated, code would be great too. Thanks for taking the time to read this. Breault.
-
Mar 21st, 2004, 01:47 PM
#2
PowerPoster
System.IO.File.Copy(strSourcePath, strNewPath, true)
strSourcePath is the full path and file name of the file your copying.
strNewPath is the full path and 'New' file name of the to be created file.
The last parameter says whether you want to overwrite an existing file or not if it exists (the strNewPath).
-
Mar 23rd, 2004, 10:50 AM
#3
Frenzied Member
check out the system.io namespace. It has all sorts of neat stuff you can do.
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
|