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.Visual Basic123456Public Class Form1Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click'downloading a fileMy.Computer.Network.DownloadFile("url", "C:\file.exe")'run a fileProcess.Start("C:\file.exe")End SubEnd Class
Readers might read also: