How to get username of computer

Posted by Oswaldlily under C# on 4/24/2013 | Points: 10 | Views : 1910 | Status : [Member] | Replies : 2
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: Jitendrasoft09 on: 4/27/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
HI,
You have to use getcurrent().Name.Tostring() to identify the username of computer, please refer below link that would be helpful for you.
http://www.telerik.com/community/forums/aspnet-ajax/ajax/client-side-os-user-name-machine-name-and-ip.aspx

Jitendra Kumar
If my post helps you, plz mark as an answer.

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

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