|
@@ -88,12 +88,13 @@ namespace YiSha.Util
|
|
|
string ip = string.Empty;
|
|
|
try
|
|
|
{
|
|
|
- string url = "http://www.net.cn/static/customercare/yourip.asp";
|
|
|
- string html = HttpHelper.HttpGet(url);
|
|
|
- if (!string.IsNullOrEmpty(html))
|
|
|
- {
|
|
|
- ip = HtmlHelper.Resove(html, "<h2>", "</h2>");
|
|
|
- }
|
|
|
+ //string url = "http://www.net.cn/static/customercare/yourip.asp";
|
|
|
+ //string html = HttpHelper.HttpGet(url);
|
|
|
+ //if (!string.IsNullOrEmpty(html))
|
|
|
+ //{
|
|
|
+ // ip = HtmlHelper.Resove(html, "<h2>", "</h2>");
|
|
|
+ //}
|
|
|
+ return "";
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -106,20 +107,20 @@ namespace YiSha.Util
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- string ip = HttpContext?.Connection?.RemoteIpAddress.ParseToString();
|
|
|
- if (HttpContext != null && HttpContext.Request != null)
|
|
|
- {
|
|
|
- if (HttpContext.Request.Headers.ContainsKey("X-Real-IP"))
|
|
|
- {
|
|
|
- ip = HttpContext.Request.Headers["X-Real-IP"].ToString();
|
|
|
- }
|
|
|
+ //string ip = HttpContext?.Connection?.RemoteIpAddress.ParseToString();
|
|
|
+ //if (HttpContext != null && HttpContext.Request != null)
|
|
|
+ //{
|
|
|
+ // if (HttpContext.Request.Headers.ContainsKey("X-Real-IP"))
|
|
|
+ // {
|
|
|
+ // ip = HttpContext.Request.Headers["X-Real-IP"].ToString();
|
|
|
+ // }
|
|
|
|
|
|
- if (HttpContext.Request.Headers.ContainsKey("X-Forwarded-For"))
|
|
|
- {
|
|
|
- ip = HttpContext.Request.Headers["X-Forwarded-For"].ToString();
|
|
|
- }
|
|
|
- }
|
|
|
- return ip;
|
|
|
+ // if (HttpContext.Request.Headers.ContainsKey("X-Forwarded-For"))
|
|
|
+ // {
|
|
|
+ // ip = HttpContext.Request.Headers["X-Forwarded-For"].ToString();
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ return "";
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|