How to get username of computer

Posted by Oswaldlily under C# on 4/24/2013 | Points: 10 | Views : 2105 | Status : [Member] | Replies : 1
I need to get username of any computer by using ipaddress
or system name


Get hostname from ipaddress
IPHostEntry ip2 = Dns.GetHostEntry("192.168.1.2");
string hostname = ip2.HostName;

Getipaddress from hostname
string ipaddress = Dns.GetHostAddresses("hostname")[0].ToString();

I need to get systemname by using ipadress or hostname




Responses

Posted by: Nadeemshaik on: 5/1/2013 [Member] Starter | Points: 25

Up
0
Down
string System_User = Environment.UserName;

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response