Search code examples
c#.netbho

Client IP address from webbrowser object


Is there any way to get client IP address from webbrowser object in Browser Helper Objects?


Solution

  • A BHO is running on the client, so you can do something like this:

    var host = Dns.GetHostName();
    var ipAddresses = Dns.GetHostAddresses(host);
    

    Mind you that it returns an array, since it's possible to have more than one IP address.