codice:
Imports System.Net.WebClient
Public Class Form1
Public WithEvents TCP As New System.Net.WebClient
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
scarica()
End Sub
Public Sub scarica()
Dim sito As New Uri("http:\\cdburnerxp.se/downloadsetup.exe")
Dim file As String = "d:\file.exe"
TCP.DownloadFileAsync(sito, file)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
'text creata solo per verificare se durante il download il form non venga bloccato... funziona!!!:)
End Sub
End Class
Così a me funziona, ma ora che provo su c:\ non mi appare , ma avendo w7 credo che ci sia il solito problema dei privilegi di accesso. cmq la funzione è funzionante.