nagendra prasad

nagendra prasad

  • NA
  • 22
  • 10.2k

I need IP address of the current user system within the remo

Nov 11 2014 11:31 PM
Hiiiiiiiii
           i need IP address of the current user in Asp.net,i used below code to get IP Address ,but i am getting IP Address of the User LAN,please suggest me 
 
var ipAddress = HttpContext.Current.Request.ServerVariables["X_FORWARDED_FOR"];
if (string.IsNullOrEmpty(ipAddress))
{
ipAddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
}
 

Answers (5)