I am working on a windows service. I need to transfer files over network using TCP/IP. Now the problem is I have only network username to connect. Is there any way I can find the ip address of a user using its network username.
Asked
Active
Viewed 582 times
-1
-
2Users have no ip addresses. Machines have. – Jan Dec 21 '11 at 11:56
-
Users can be logged into multiple machines and may not have a single associated IP address. This is not going to be possible. – Cody Gray - on strike Dec 21 '11 at 12:01
-
By user network name i mean the machine name. – Harsh Dec 21 '11 at 12:58
1 Answers
2
string name = "somename";
IPAddress[] addresslist = Dns.GetHostAddresses(name);
foreach (IPAddress theaddress in addresslist)
{
Console.WriteLine(theaddress.ToString());
}

Elastep
- 3,272
- 1
- 14
- 16