[OperationContract]
public string GetCustomerIP()
{
string CustomerIP = "";
if( HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null)
CustomerIP = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
else if (HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"] != null)
CustomerIP = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].ToString();
return CustomerIP;
}
浙公网安备 33010602011771号