Results 1 to 2 of 2

Thread: Problems trying to copy files and such

  1. #1
    Guest
    This might be a pretty silly question but I am trying to make program in VB 6 that will copy a file. I have 2 text boxes one for the directory name and one for the file name. I then want to click a button and have the info from the 2 text boxes make up the directory name and file name, so it would be something like e:\"textbox1"\"textbox2.jpg" Anyone have any idea how to do this? Thanks!
    -Adam

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    'copy or save a file to a different directory
    'provided text1 = a valid dir path
    'and text 2 a valid file path
    'If not errors will occur and you will have to trap them


    Private Sub Command1_Click()

    Dim SourcePath As String, DestPath As String
    SourcePath = text1.text & "\" & text2.text

    'where you are copying the file to
    DestPath = "c:\download\whodoneit.txt"


    FileCopy SourcePath, DestPath

    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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