Trace IpAddres of user

Posted by Alok under ASP.NET on 4/6/2011 | Points: 10 | Views : 1321 | Status : [Member] | Replies : 2
I want asp.net Application to trace IpAddress of visitors on my website.And also to Trace which Page is visited by that user.

Thanks & Regards,
Alokssm



Responses

Posted by: Vuyiswamb on: 4/6/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
The first question is how to get an IP address of a user accessing your side

   String  strClientIP;  

strClientIP = Request.UserHostAddress();


Second Question should be , how to store this IP for later use

Store it in the Database , i can write more until you ask.

All the answers can be found here in Dotnetfunda, but using our search facility on your right hand corner of the page

http://www.dotnetfunda.com/search/Search.aspx

Thank you for posting at Dotnetfunda

Vuyiswa Maseko


Thank you for posting at Dotnetfunda
[Administrator]

Alok, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lalji_mer on: 4/6/2011 [Member] Bronze | Points: 25

Up
0
Down
you can simple use HTTP_X_FORWARDED_FOR like may be this...
http://javascript.internet.com/user-details/ip-address.html

HttpContext.Current.Request.UserHostAddress; 


HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];


LP MER

Alok, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response