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!

    1 50.00%
  • Was this suposed to present a challenge?

    0 0%
  • Is this kid an idiot?

    1 50.00%
  • What's copying a file mean?

    0 0%
Results 1 to 3 of 3

Thread: How can I copy a file to a new location?

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2002
    Location
    Canada
    Posts
    7

    Question 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.

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    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).

  3. #3
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    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
  •  



Click Here to Expand Forum to Full Width