Bilgiler > Asp.net Ziyaretçi İp adresi alma
Asp.net Ziyaretçi İp adresi alma
string ZiyaretciIPsi = "";
if (HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null)
{
ZiyaretciIPsi = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
}
else if (HttpContext.Current.Request.UserHostAddress.Length != 0)
{
ZiyaretciIPsi = HttpContext.Current.Request.UserHostAddress;
}
***