Ok thanks! But I don't think that's what I need. What I need is for a user to input a username and a pass then when they click submit it will check in the users folder on the server is a file exists with the name "username.txt" username will be the variable for the text field.
How do I use the text field as the txt name in the list command?
B4X:
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
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