-
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
-
<?>
'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