1. Home
  2. Docs
  3. Details
  4. Technical Specification
  5. Windows Sample Code

Windows Sample Code

The Windows OS applications (e.g., Chrome browser) are built using ASP.NET framework (C#
programming language). This framework provides four ways to get the name of the machine or
computer:

  1. string MachineName 1 = Environment.MachineName;
  2. string MachineName2 = System.Net.Dns.GetHostName();
  3. string MachineName3 = Request.ServerVariables[“REMOTE_HOST”].ToString(); and
  4. string MachineName4 = System.Environment.GetEnvironmentVariable(“COMPUTERNAME”).
// Sample for the Environment.MachineName property
using System
class Sample {
	public static void Main() {
		Console.WriteLine();
		// <-- Keep this information secure! -->
		Console.WriteLine("MachineName: {0}", Environment.MachineName);
	}
}

How can we help?