i use net lib
but Chinese file name is Garbled
B4X:
Sub Activity_Create(FirstTime As Boolean)
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("1")
If FirstTime Then
FTP.Initialize("FTP", "192.168.1.103", 21, "zyq", "zyq")
FTP.List("/")
End If
End Sub
B4X:
Sub FTP_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry)
Log(ServerPath)
If Success = False Then
Log(LastException)
Else
For i = 0 To Folders.Length - 1
Log(Folders(i).Name)
Next
For i = 0 To Files.Length - 1
Dim a() As Byte
a=Files(i).Name.GetBytes("UTF8")
Dim msg As String
msg=BytesToString(a,0,a.Length,"GBK")
Log(msg & ", " & Files(i).Size & ", " & DateTime.Date(Files(i).Timestamp))
Next
End If
End Sub
but Chinese file name is Garbled