This Visual Basic Tutorial is all about Download and Run File.
In this tutorial, we will learn on how to download and run a file in Visual Basic 2008.
Let’s begin :
- Open the Visual Basic, select “File” on the menu, hit new and create a new project.
- The New Project dialog will appear.
Select “windows” in the project types, hit the “windows form application” in the templates and hit “ok“.
- In the toolbox select a button and drag it into the form.
- Add the following code in the code editor.
- Public Class Form1Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- 'downloading a file
- My.Computer.Network.DownloadFile("url", "C:\file.exe")
- 'run a file
- End SubEnd Class
Readers might read also: