we can track the IP address of the user if when they visit my site.
Following is the code to know the user IP address
HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
or
HttpContext.Current.Request.UserHostAddress;
To get the IP address of the machine and not the proxy use the following code
HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
Search This Blog
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment