Search code examples
c#vb.nettcpremoting

Getting ip address from user name in VB.net


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.


Solution

  • string name = "somename";
    IPAddress[] addresslist = Dns.GetHostAddresses(name);
    
    foreach (IPAddress theaddress in addresslist)
    {
       Console.WriteLine(theaddress.ToString());
    }