How do I get the computer name in .NET c#
C# – How to get the computer name in .NET
.netc++
Related Question
- C# – How to cast int to enum
- C# – Deep cloning objects
- C# – How to enumerate an enum
- C# – What are the correct version numbers for C#
- .net – the best algorithm for overriding GetHashCode
- C# – How to get a consistent byte representation of strings in C# without manually specifying an encoding
- .net – Difference between decimal, float and double in .NET
- C# – How to get the current username in .NET using C#
Best Solution
System.Environment.MachineName
from a console or WinForms app.HttpContext.Current.Server.MachineName
from a web appSystem.Net.Dns.GetHostName()
to get the FQDNSee How to find FQDN of local machine in C#/.NET ? if the last doesn't give you the FQDN and you need it.
See details about Difference between SystemInformation.ComputerName, Environment.MachineName, and Net.Dns.GetHostName