NET library , FTP Send command, use this LIST command
http://www.cs.cf.ac.uk/Dave/Internet/node123.html#SECTION00665400000000000000
it is exactly what you need lol
on button_click event call SendCommand (Command As String, Parameters As String)
B4X:SendCommand ("LIST", youruserfiekd.text & ".txt")
Sub Globals
Dim Username As EditText
End Sub
Sub Login_Click
FTP.List("/public_html/users/Username.txt")
End Sub
Sub FTP_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry)
Log(ServerPath)
If Success = True Then
RemoveViews
Activity.LoadLayout("main")
End If
End Sub
Sub FTP_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry)
Log(ServerPath)
If Success = True Then
For i = 0 To Files().Size -1
If Files(i).Name.Contains(Username.Text.Trim) Then
'User File Found On Server
RemoveViews
Activity.LoadLayout("main")
Else
Msgbox("User Not Found...", "NOTICE")
End If
Next
End If
End Sub
Change the FTP_ListCompleted to this:
B4X:Sub FTP_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry) Log(ServerPath) If Success = True Then For i = 0 To Files().Size -1 If Files(i).Name.Contains(Username.Text.Trim) Then 'User File Found On Server RemoveViews Activity.LoadLayout("main") Else Msgbox("User Not Found...", "NOTICE") End If Next End If End Sub
Sorry but it returns with an error
Error description: Missing parameter.
Occurred on line: 77
For i = 0 To Files().Size -1
For i = 0 To Files.Length -1
For i = 0 To Files.Size -1