This Tutorial is all about How to Copy a File using VB.Net. In this tutorial you will learn about How to Copy a File using VB.Net. So lets get Started:
- First is open the Visual Basic, Select File on the menu, then click New and create a new project.
- Then a New Project Dialog will appear. You can rename your project, depending on what you like to name it. After that click OK
- Design your form like this just like what I’ve shown you below.
Add a Textbox, Button and Label.
- After that add this code to the Source Browse button.
Dim fDialog As New OpenFileDialog
txtsource.Text = fDialog.FileName
tempFileName = fDialog.SafeFileName
- Add this code to the Destination Browse button.
Dim fDialog As New FolderBrowserDialog
txtdestination.Text = fDialog.SelectedPath & “\” & tempFileName
- Then add this code to the Copy Button.
If txtsource.Text.Length > 0 And txtdestination.Text.Length > 0 Then
- Finally Click F5 to run.
If you have any comments or suggestion about on How to Copy a File using VB.Net, Please Feel Free to contact our webpage.
Download How to Copy a File using VB.Net Code Here
Other articles you might read also:
- How to Get the Average of Two Numbers in VB.Net
- How to Reorder List in Listbox using VB.Net
- Get List of Installed Fonts Using ListBox in VB.Net