#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim ftp1 As FTP
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim btn1 As Button
Dim btn2 As Button
Dim btn3 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Layout1")
If FirstTime Then
Try
ftp1.Initialize("ftp1", "ftp.********.it",21,"*****@aruba.it", "********")
Catch
Msgbox("Impossibile l'Upload", "messaggio d'errore")
End Try
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub btn1_Click
Risuftp ("Espo0.txt")
End Sub
Sub btn2_Click
Risuftp ("Espo1.txt")
End Sub
Sub btn3_Click
Risuftp ("Espo2.txt")
End Sub
Sub Risuftp(s As String)
Try
ftp1.UploadFile(File.DirDefaultExternal, s, True,"********/dati/" & s)
Catch
Msgbox("Problemi con FTP", "Errore imprevisto" )
End Try
End Sub
Sub ftp1_UploadProgress (ServerPath As String, TotalUploaded As Long, Total As Long)
Dim s As String
s = "Uploaded " & Round(TotalUploaded / 1000) & "KB"
If Total > 0 Then s = s & " out of " & Round(Total / 1000) & "KB"
Log(s)
End Sub
Sub ftp1_UploadCompleted (ServerPath As String, Success As Boolean)
Log(ServerPath & ", Success=" & Success)
If Success = False Then Log(LastException.Message)
End Sub