csharp Environment Variables

System.Text.StringBuilder sb = new System.Text.StringBuilder();

sb.AppendFormat("<p>Processor Count: {0}</p>", Environment.ProcessorCount);
sb.AppendFormat("<p>OS Version: {0}</p>", Environment.OSVersion);
sb.AppendFormat("<p>Machine Name: {0}</p>", Environment.MachineName);
sb.AppendFormat("<p>64bit OS?: {0}</p>", Environment.Is64BitOperatingSystem);
sb.AppendFormat("<p>64bit Process?: {0}</p>", Environment.Is64BitProcess);

Response.Write(sb.ToString());

//outputs:
/*
	Processor Count: 4
	OS Version: Microsoft Windows NT 6.0.6002 Service Pack 2
	Machine Name: MATT-PC
	64bit OS?: True
	64bit Process?: False
*/
Gets Environment Variables.

Updated: Friday 8th April 2011, 11:05am

There are 0 comments

Leave a comment of your own

Comments are currently closed.