Answer:
Environment.MachineName :
Environment is a class defined by System Namespace.
MachineName is its property.
It reads the NetBIOS name of local computer..
SystemInformation.ComputerName :
SystemInformation is a class defined by System.Windows.Forms Namespace
ComputerName is its property,
output:
Same as Environment.MachineName
Dns.GetHostName :
Dns is a class defined by System.Net namespace:
GetHostName is its method.
It gets host name of computer which refers to a domain name that has one or more associated IP adresses.
Asked In: Many Interviews |
Alert Moderator