Thursday, July 11, 2013

C# - Get Computer Name


string hostName = Environment.MachineName;
string name = System.Net.Dns.GetHostName();
string name1 = System.Windows.Forms.SystemInformation.ComputerName;
string name2 = System.Environment.GetEnvironmentVariable("COMPUTERNAME");

No comments:

Post a Comment