asp.netclientip-addressclientip

Can we get IP address and/or machine of client accessing a particular website?


I'm having a scenario wherein I need either the machine name of the client who is accessing my website or his actual IP address.

I did a lot of searching and browsing and I found that most of the responses suggested me to use Request.ServerVariables["REMOTE_ADDR"] or Request.UserHostAddress. But this is not what I'm looking for. Both of these are returning the server's IP address instead of the actual IP address of the client who is accessing my website.

I found this particular article that shows how to get the IP address of the client using some external web service call. I tried it but it didn't work.

I even found many responses saying that getting the actual IP address isn't possible and getting the machine name of the client is also not possible if the client is accessing from outside the intranet.

Can someone please confirm this and correct me if I'm wrong? Thank you. :)


Solution

  • try this site

    http://www.geekpedia.com/tutorial45_How-to-get-IP-address-of-client.html
    

    here they have given a way to do it may be it will help