|
|
'Make sure you import "Imports System.IO"
Dim openFileDialog1 As OpenFileDialog
Try
If OpenFileDialog1.ShowDialog <> DialogResult.Cancel Then
File.Copy(OpenFileDialog1.FileName, TextBox1.Text & "\" & _
OpenFileDialog1.FileName.Substring(OpenFileDialog1.FileName.LastIndexOf("\")))
End If
Catch e As Exception
MsgBox("Error: " & e & " while coping file from " & TextBox1.Text)
End Try
|