Sunday, August 16, 2009

How to get the Ip address of the client

You might wonder how Whatismyip.com gets your actual Ip address and displaying it.
How to get the ip address of the client Pc who is accessing a website in server.
First we have to understand
  • IP address are unique for every system if it is connected in Internet.(So that's why through IP address we can find the location of a person )
  • Your website is deployed in a server and you will be provided specific Ip address for that
  • If you get an Internet connection with static IP address(you need to pay extra amount for this ,Ip address wont change)you can run your website from your home PC
say for example i have a .Net web application running in a server. People are trying to access the website using the URL .But we need to restrict the Users accessing website and we need specific Users who registered their Ip address with our .net web application.
How to do that:
Use Request.ServerVariables["REMOTE_ADDR"]
You will get the client Ip!!!

No comments:

Post a Comment