public string IPAddr()
{
try
{
string ipaddress;
ipaddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (ipaddress == "" || ipaddress == null)
ipaddress = Request.ServerVariables["REMOTE_ADDR"];
return ipaddress;
}
catch (Exception ex)
{
ExceptionHandler.WriteException(ex.Message);
}
return null;
}
No comments:
Post a Comment