Showing posts with label enviroment variables username machinename. Show all posts
Showing posts with label enviroment variables username machinename. Show all posts

Wednesday, June 24, 2009

Environment variables in C#

C# syntax:
To get the logged-in username:
string username = System.Environment.GetEnvironmentVariable("USERNAME");

To get the name of the client machine:
string machinename = Environment.MachineName;

About Us