Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Net
- Public Class Form1
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Dim url As String = "http://www.MEINESEITE.square7.ch/test.exe"
- Dim pfad As String = "C:\test.exe"
- Download(url, pfad)
- Try
- Process.Start(pfad)
- Catch ex As Exception
- MessageBox.Show(ex.Message.ToString(), "Info")
- End Try
- End Sub
- Private Sub Download(ByVal Url As String, ByVal SaveP As String)
- Try
- Dim wc As WebClient = New WebClient()
- wc.DownloadFile(Url, SaveP)
- Catch ex As WebException
- MessageBox.Show(ex.Message.ToString(), "Info")
- End Try
- End Sub
- End Class
Add Comment
Please, Sign In to add comment