#Region Shared Files
#CustomBuildAction: folders ready, %WINDIR%\System32\Robocopy.exe,"..\..\Shared Files" "..\Files"
'Ctrl + click to sync files: ide://run?file=%WINDIR%\System32\Robocopy.exe&args=..\..\Shared+Files&args=..\Files&FilesSync=True
#End Region
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Private Sub Button1_Click
'xui.MsgboxAsync("Hello world!", "B4X")
'ftp was previously initialized And its event name was set To ftp:
Dim ftp As FTP
ftp.Initialize("ftp", "www.mysite.it", 21, "user@provider.it", "password")
Dim sf As Object = ftp.DownloadFile("PathOnServer\FileName.txt", True, File.DirDefaultExternal, "somefile.txt")
Wait For (sf) ftp_DownloadCompleted (ServerPath As String, Success As Boolean)
If Success Then
Log("file was downloaded successfully")
Else
Log("Error downloading file")
End If
End Sub