Click to See Complete Forum and Search --> : In which way to get the host name?


sharong
March 8th, 2005, 09:35 AM
I need to get the host name of the local PC/Workstation, so I can use the:
Dns.GetHostName() or Environment.MachineName

What is the difference between the two? when I read the documentation I couldn't decide which one to use.
I must say the the PC may not be connected to the Internet/Intranet.

Which one should I use?
Is there any other way to get the local host name which is better then the above two?

Krzemo
March 8th, 2005, 04:05 PM
I think "Environment.MachineName" would be better (if U want netbios name).

Best regards,
Krzemo.