B4J Question Network Directory Question.

rspitzer

Active Member
I would like to show a list of network devices so the user can just click on the device and log in.
In ubuntu, in its file explorer, the left hand pane lists directory's that are present on the drive.
Lower in the pane is a Title - Network and underneath this title is Browse Network.
When you open this dialog, you get a listing of devices, some are printers and such, but also other computers on the network.
What I would like to do, is present a list of these devices to the user, the user would then choose what to open, and of course login using their credentials.
Is there a way to list these devices?
 

rspitzer

Active Member
I was able to get a list of devices using the SMB client. The list would show me the smb devices that the local file explorer showed. As an example one of the folders was called workgroup, I could then further list the devices under workgroup and eventually get a list of files. Unfortunately the only problem I ran into was the "SetCredentials" property, for the life of me I could not for some reason get this to work. In order to actually explore the files in the folders, I had to manually login to the device on the linux file explorer. Anyway this is a moot point, in the process of doing this, I realized this was definitely not the way to go, especially if a file that was needed off the client device was buried under a ton of sub folders. I settled on just asking the user for a device ip address, shared directory name, user name and password, which I then just create a bash script that mounts the necessary directory to a local share. This was an interesting exercise though. Thanks.
 
Upvote 0
Top