If FTPMode="FTP" Then
Msgbox(Nfile,FTPMode&"-"&FTPHost&"-"&FTPPort&"-"&FTPUser&"-"&FTPPwd
FTP.Initialize("FTP", FTPHost, FTPPort, FTPUser, FTPPwd)
FTP.PassiveMode=False
FTP.DownloadFile(Nfile, False, sdRoot, Nfile)
Else
'locale, lanciamo l'inserimento in tabella
PopolaTabelle
End If
Sub FTP_DownloadProgress (ServerPath As String, TotalDownloaded As Long, Total As Long)
Dim s As String
s = "Downloaded " & Round(TotalDownloaded / 1000) & "KB"
LblStatus.Text="File "&Nfile&" "&s&"..."
If Total > 0 Then
s = s & " out of " & Round(Total / 1000) & "KB"
Log(s)
End If
End Sub
Sub FTP_DownloadCompleted (ServerPath As String, Success As Boolean)
Log(ServerPath & ", Success=" & Success)
If Success = True Then
' FTP.Close
' PopolaTabelle
Msgbox("ok","ftp down")
Else
Msgbox("Errore nella Ricezione o File Non Trovato!",Main.nomeprog)
App.IdleTimerDisabled = False 'togliamo lo standby
End If
End Sub