C# .NET: Get the Name of the Local Machine .NET

2/18/2014 12:54:35 AM

The following will get the name of the local machine in .NET and C#.

System.Environment.MachineName
HttpContext.Current.Server.MachineName
System.Net.Dns.GetHostName()