Copy file sample in visual basic
FileCopy is the simplest way to copy a file. Use this sample or part of the example to make a efficient file copy tool.
Here is how it works:
'calling the FileCopy method, very simple FileCopy(Source, Destination) |
I made a sample project, you could download it. There is nothing special inside. I added a little function tool to help the user get the files names, SAmpleCopyFile.zip
''' <summary> ''' This is a sample ''' This show you how to use FileCopy method to copy a file ''' There are better way to copy a file other than FileCopy ''' ''' This is very basic, there is no checking, no security, no rights. ''' Use copy file for simple task or basic operations. ''' </summary> ''' <remarks></remarks> Public Class Form1 Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load Dim Source As String = "" Dim Destination As String = "" 'get a file name Using oOpenFileDialog As New OpenFileDialog If oOpenFileDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then Source = oOpenFileDialog.FileName End If End Using 'Get the name to save to Using oSave As New SaveFileDialog If oSave.ShowDialog = Windows.Forms.DialogResult.OK Then Destination = oSave.FileName End If End Using 'calling the FileCopy method, very simple FileCopy(Source, Destination) Me.Close() 'close the form because the sample is completed. End Sub End Class |
This email is free from viruses and malware because avast! Antivirus protection is active. |
Update Contact :
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email : Fajarudinsidik@gmail.com
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email: Fajarudinsidik@gmail.com
atau Kirimkan Private messanger melalui email dengan klik tombol order dibawah ini :