Private Overloads Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim FSO As Object
Dim strSource As String, strDestination As String
strSource = "D:\Test1\MRPII.BaseData.txt" 'กำหนดตำแหน่งโฟลเดอร์ต้นทาง
strDestination = "C:\Program Files\Test2\" 'กำหนดตำแหน่งโฟลเดอร์ปลายทาง
FSO = CreateObject("Scripting.FileSystemObject")
FSO.CopyFile(strSource, strDestination, True)
Label2.Text = "success!!"
FSO = Nothing
Catch ex As Exception
Label2.Text = "No success!!"
End Try
End Sub
End Class