Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Dim FTP As FTP
Private Button2 As Button
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("pluto") 'Load the layout file.
MainForm.Show
End Sub
Sub FTP_DownloadProgress (ServerPath As String, TotalDownloaded As Long, Total As Long)
Dim s As String
s = "Downloaded " & Round(TotalDownloaded / 1000) & "KB"
If Total > 0 Then s = s & " out of " & Round(Total / 1000) & "KB"
Log(s)
End Sub
Sub FTP_DownloadCompleted (ServerPath As String, Success As Boolean)
Log(ServerPath & ", Success=" & Success)
If Success = False Then
Log(LastException.Message)
End If
End Sub
Sub Button2_MouseClicked (EventData As MouseEvent)
FTP.Initialize("FTP", "ftp.cpc.ncep.noaa.gov", 21, "anonymous", "")
Log("Results:" & FTP.IsInitialized)
FTP.PassiveMode=True
If FTP.IsInitialized Then
FTP.DownloadFile("wd52dg/data/indices/tele_index_nh", True, File.DirApp, "esempio.txt")
End If
End Sub