Get a computer’s name by using the static method Dns.GetHostName.
Required Namespace:
using System.Net;
The code:
String ComputerName = Dns.GetHostName();
MessageBox.Show("You Computer Name is :” + ComputerName);
using System.Net;
String ComputerName = Dns.GetHostName();
MessageBox.Show("You Computer Name is :” + ComputerName);