I want show a message when all files of my list is success downloaded.
This code not work. Erel, how can implement a counter? Writen at...
https://www.b4x.com/android/forum/threads/android-ftp-tutorial.10407/page-13#post-369277
#252
This code not work. Erel, how can implement a counter? Writen at...
https://www.b4x.com/android/forum/threads/android-ftp-tutorial.10407/page-13#post-369277
#252
B4X:
Sub ButtonDownloadList_Click
Dim FolderName As String :FolderName="Namen/"
FTP.List(FolderName)
End Sub
Sub FTP_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry)
Dim FolderName As String :FolderName="Namen/"
Log(ServerPath)
Log(LastException)
ToastMessageShow("Verbindungsfehler: "&LastException, True)
FTP.CloseNow
Else
ServerGeladen=ServerGeladen+1
TimerDownload.Initialize("TimerDownload",3000)
TimerDownload.Enabled=True
For i = 0 To Folders.Length - 1
Log(Folders(i).Name)
Next
For i = 0 To Files.Length - 1
Log(Files(i).Name & ", " & Files(i).Size & ", " & DateTime.Date(Files(i).Timestamp))
FTP.DownloadFile(FolderName&Files(i).Name,True, PfadDownload,Files(i).Name)
ToastMessageShow(Files(i).Name&" wird geladen...",False)
Next
FTP.Close
End If
If Success AND ServerGeladen>=Files.Length Then
ToastMessageShow(Files.Length&" Daten wurden erfolgreich geladen",False)
TimerDownload.Enabled=False
listViewDownloadOpen=False
ServerGeladen=-2
End If
End Sub
Sub TimerDownload_tick
ToastMessageShow("wird geladen..." ,False)
End Sub