You can use System.Windows.Forms.dll and the class SystemInformation. You can also use System.Environment.MachineNameor System.Environment.GetEnvironmentVariable("COMPUTERNAME"). And if you are truly loyal, you can do P / Invoke in user32.dll to call the corresponding Win32 API.
source
share