Retrieving host name of a connected shared folder

I need to retrieve the host name of a mac, that I am connected to after the user has selected a folder on it in a desktop xojo app.
Can anyone tell me how to obtain the host name?

I use MBS for this. It includes an EndofLine so I remove this:

ReplaceAll(SystemInformationMBS.HostName, EndOfLine, "").Trim

Not sure if this is the HostName you mean? If you mean the HostName of a connected network drive then I’m not sure.

@David Cox : Thanks, that indeed gives me the hostname for the computer I’m running my App on,
but what I need is the hostname of a mounted folder item.
The user can select a (mounted or local) folder; I need to know the IP address or Hostname of the computer on which that folder resides.
If the users selects a local folder, SystemIformationMBS.hostname works fine, but otherwise it doesn’t;
any suggestions?

Try the “/sbin/mount” command in shell. You can parse its output.

@Thomas Eckert : Thank you, that does indeed give me the hostname.