Gets user name
using System; class Sample { public static void Main() { Console.WriteLine("UserName: {0}", Environment.UserName); } }