Directory folders in SMB

pobss

Member
Licensed User
Longtime User
hello all,
with library smb
use a listbox with this code to move into shared folders on the PC.
how can I go back one folder at a time?

thanks

B4X:
Sub ListView2_ItemClick (Position As Int, Value As Object)
   If str.EndsWith("/")=True Then
      str= str & "" & Value
   Else
      str= str & "/" & Value
   End If

   SMB1.ListFiles(str, "")
   
   Log(str)
End Sub
 

pobss

Member
Licensed User
Longtime User
I came to this code works very well.
you can simplify or okay?

B4X:
Sub ListView2_ItemClick (Position As Int, Value As Object)
   lstDir.AddSingleLine(Value)
End Sub

Sub cmd_dir_back_Click
Try

Dim x As Int
Dim sDir,L As String

L=lstDir.Size-1

lstDir.RemoveAt(L)

For x = 0 To L-1
sDir=sDir & lstDir.GetItem(x)
Next

str="smb://" & Spinner1.SelectedItem & "/" & sDir
Log(str)

Catch

End Try

End Sub

with spinner selected the name server (home,work..)
 
Upvote 0
Top