April 24, 2011

How to Read client's IP address in ASP.Net

Method 1:
Request.ServerVariables("REMOTE_ADDR")

Method 2:
string ipAddress = HttpContext.Current.Request.UserHostAddress.ToString();

No comments:

Post a Comment