Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/06/2009, 09:05
Avatar de Keyenight
Keyenight
 
Fecha de Ingreso: febrero-2009
Ubicación: En la PC usando VB
Mensajes: 42
Antigüedad: 16 años
Puntos: 0
Descargar archivo de servidor ftp

Tengo un servidor ftp, mi problema es el siguiente cuando intento descargar archivos del servidor con el siguiente codigo:
Código vb:
Ver original
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.         On Error GoTo err
  3.         GoTo cont
  4. err:
  5.         MsgBox(Err.Description, MsgBoxStyle.Exclamation Or MsgBoxStyle.OkOnly, "Error #" & Err.Number)
  6.         My.Computer.Clipboard.SetText(Err.Description)
  7.         If File.Exists("C:\file.exe") Then
  8.             Kill("C:\file.exe")
  9.         End If
  10.         Exit Sub
  11. cont:
  12.         With My.Computer.Network
  13.             If .Ping("ftp://host.net") Then
  14.                 MsgBox("Conexión establecida.", MsgBoxStyle.OkOnly Or MsgBoxStyle.Information, "ftp://host.net")
  15.             End If
  16.             .DownloadFile("ftp://host.net/file.exe", "C:\file.exe", "user", "password", True, 500, True)
  17.         End With
  18.     End Sub

Entonces hace como si fuera a descargar y cuando comienza da estos 2 errores aveces uno y aveces otro:
No es posible conectar con el servidor remoto
Se ha terminado la conexión: El servidor ha cometido una infracción de protocolo.
Que prodrá ser, gracias por su ayuda.