Monday, October 11, 2010

Readout Computer Name

To find out the name of the own computer using C#, there are 2 simple possibilites:
Using the class Dns (using System.Net is required):

string ComputerName = Dns.GetHostName();

And using the class SystenInformation:

string ComputerName = System.Windows.Forms.SystemInformation.ComputerName.ToString();

No comments:

Post a Comment