30- Download and Run File

0
327

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 :

  1. Open the Visual Basic, select “File” on the menu, hit new and create a new project.
    01_helloworld
  2. The New Project dialog will appear.
    create2s
    Select “windows” in the project types, hit the “windows form application” in the templates and hit “ok“.
  3. In the toolbox select a button and drag it into the form.
    downloadf1
  4. Add the following code in the code editor.
    1. Public Class Form1Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2. 'downloading a file
    3. My.Computer.Network.DownloadFile("url", "C:\file.exe")
    4. 'run a file
    5. Process.Start("C:\file.exe")
    6. End SubEnd Class

 

 

Readers might read also:

 

 

Facebook Comments
(Visited 29 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here