Dim FTPDWN As FTP
FTPDWN.Initialize("FTPDWN",m.Get("d01"),m.get("d02"),m.Get("d03"),m.Get("d04"))
FTPDWN.PassiveMode = True
Dim sf As Object = FTPDWN.DownloadFile(remotepath,False,localpath,remotefile)
wait for (sf) FTPDWN_DownloadCompleted (ServerPath As String, Success As Boolean)
If Success Then
Log("download "&remotefile)
' importo il file e lo cancello
ImportToDatabase(remotefile)
Log("importato "&remotefile)
' scaricato correttamente sposto
Dim WO As Object = FTPDWN.SendCommand("RNFR",remotepath)
wait for (WO) FTPDWN_CommandCompleted (Command As String, Success As Boolean, ReplyCode As Int, ReplyString As String)
Dim WO As Object = FTPDWN.SendCommand("RNTO",remotehstpath)
wait for (WO) FTPDWN_CommandCompleted (Command As String, Success As Boolean, ReplyCode As Int, ReplyString As String)
Log("ridenominato "&remotefile)
MB00.SetMessage(fx.Colors.rgb(0,150,0),"File "&remotefile&" scaricato correttamente !",Chr(0xF071),True)
Else
MB00.SetMessage(fx.Colors.rgb(150,0,0),LastException.Message,Chr(0xF071),False)
Log(LastException.Message)
End If
FTPDWN.Close