Android Question Access NAS with SMB


Active Member
Licensed User
Longtime User

I am trying to connect to a NAS with the SMB library. Previous test with a Raspberry pi worked. Now I have a diskstation and I can not figure out how to connet. I have multiple users and folders.
    Dim SMB2 As SMB
    SMB2.SetCredentials(username, passwd, ???)
    SMB2.ListFiles("smb://" & url, "")
The question is now what do I have to enter for domain in the credentials and what do I have to enter as url? I suppose the url is the network name of the nas combined with the share name and the folder I want to access.
Any tips on what goes where?

edit: if I do a SMB2.GetDiskFreeSpace("smb://" & url, "") I get success but only for the top most URL without subfolders also with or without setcredentials.

Edit: god damn it it was the v1 disabled again. Does the SMB library support v2? Samba v1 is not very secure.
Last edited:


Well-Known Member
Licensed User
To answer your last question, You do not write in your post which SMB library you are using. From the fact that you are using the SMB2.GetDiskFreeSpace command, it does not appear to be DonManfred's B4A Library jcifs-ng SMB-Client (SMB2) library that does support SMB2.
Upvote 0