Cita:
Iniciado por Peterpay
Entonces mejor usa la clase
WebClient
y su metodo DownloadFile o DownloadData
y como se usa esa clase

intente hacerlo como sale en la pagina de la microsoft pero me marca errores, y no se donde se pone la ruta de descarga, este es el código que puse:
Código vb:
Ver originalPublic Sub DownloadFile( _
ByVal address As String, _
ByVal fileName As String _
)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim remoteUri As String = "http://111.111.111.11:8090/archivos/"
Dim fileName As String = "archivo.rar"
Dim myStringWebResource As String = Nothing
' Create a new WebClient instance.
Dim myWebClient As New WebClient()
' Concatenate the domain with the Web resource filename. Because DownloadFile
'requires a fully qualified resource name, concatenate the domain with the Web resource file name.
myStringWebResource = remoteUri + fileName
Console.WriteLine("Downloading File ""{0}"" from ""{1}"" ......." + ControlChars.Cr + ControlChars.Cr, fileName, myStringWebResource)
' The DownloadFile() method downloads the Web resource and saves it into the current file-system folder.
myWebClient.DownloadFile(myStringWebResource, fileName)
Console.WriteLine("Successfully Downloaded file ""{0}"" from ""{1}""", fileName, myStringWebResource)
Console.WriteLine((ControlChars.Cr + "Downloaded file saved in the following file system folder:" + ControlChars.Cr + ControlChars.Tab + Application.StartupPath))
End Sub
me marca error en estas lineas:
Código vb:
Ver originalDim myWebClient As New WebClient() ' "El tipo WebClient no esta definido
Console.WriteLine((ControlChars.Cr + "Downloaded file saved in the following file system folder:" + ControlChars.Cr + ControlChars.Tab + Application.StartupPath))
'en esta ultima me dice : ' " StartupPath no es un miembro de system.windows.form.application
me podrías dar una manito con esto por favor!!!