-1

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.

Harsh
  • 3,683
  • 2
  • 25
  • 41

1 Answers1

2
string name = "somename";
IPAddress[] addresslist = Dns.GetHostAddresses(name);

foreach (IPAddress theaddress in addresslist)
{
   Console.WriteLine(theaddress.ToString());
}
Elastep
  • 3,272
  • 1
  • 14
  • 16