if(!string.IsNullOrEmpty(HttpContext.Request.ServerVariables["HTTP_VIA"]))
IsNullOrEmpty:判断字符串是空引用,或者值为空。
HTTP_VIA:代理服务器
HttpContext.Request.ServerVariables: https://blog.youkuaiyun.com/linshichen/article/details/52786701
{
ip=HttpContext.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
HTTP_X_FORWARDED_FOR:获取到的ip地址 https://blog.youkuaiyun.com/ccfxue/article/details/73693477