ComputerName() / HostName()

Just starting out? Need help? Post your questions and find answers here.
Splunk
User
User
Posts: 36
Joined: Wed Apr 21, 2021 6:53 pm

ComputerName() / HostName()

Post by Splunk »

I am writing a server/client application. Server or client can be any computer in this network. The computer that starts the program first is automatically the server.

Where exactly is the difference between the functions computername() vs. hostname()? For me the result is always the same.
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 456
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: ComputerName() / HostName()

Post by Mindphazer »

HostName() is in the Network section of the help, so I guess you should preferably use it, as you write a client/server application.
It might be the NetBIOS name of the computer.
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
Splunk
User
User
Posts: 36
Joined: Wed Apr 21, 2021 6:53 pm

Re: ComputerName() / HostName()

Post by Splunk »

Ok, thanks. You have put me on the right track with NetBios. The hostname could possibly also contain the domain name.
Post Reply