/// <summary>
/// 获取IP地址
/// </summary>
public static string IPAddress
{
get
{
string userIP;
// HttpRequest Request = HttpContext.Current.Request;
HttpRequest Request = HttpContext.Current.Request; // ForumContext.Current.Context.Request;
// 如果使用代理,获取真实IP
if (Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != "")
userIP = Request.ServerVariables["REMOTE_ADDR"];
else
userIP = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (userIP == null || userIP == "")
userIP = Request.UserHostAddress;
return userIP;
}
}

  

最新文章

  1. scrapy的scrapyd使用方法
  2. Java多线程18:线程池
  3. 计算字符串高度 iOS
  4. AxureRP7.0教学大纲Tutorial directory
  5. Vue.2.0.5-Render 函数
  6. Oracle正则表达式之匹配网址
  7. java使用字节流和字符流实现文件复制
  8. codeforces 862B B. Mahmoud and Ehab and the bipartiteness
  9. [HNOI2008] GT考试
  10. Expression Trees 参数简化查询
  11. Servlet CDI example analysis
  12. 3D游戏的角色移动和旋转
  13. 算法笔记 3.2 codeup1934 找X
  14. how to generate an analog output from a in-built pwm of Atmega 32AVR microcontrloller?
  15. syslinux 和 grub
  16. Windows Server 2012设置WinDbg Kernel Debugging Local
  17. 【2017.12.05 智能驾驶/汽车电子】转载:如何成为一名无人驾驶工程师 By刘少山
  18. Java之深入JVM(6) - 字节码执行引擎(转)
  19. idea中dependencies中总是有红色波浪线(缺少dependency)问题
  20. redis——持久化方式RDB与AOF分析

热门文章

  1. Python条件控制与循环
  2. python 字符词串和字符串的转换
  3. 【webpack4】webpack4配置需要注意的问题
  4. PHP基础-表达式介绍
  5. BZOJ 4769: 超级贞鱼 逆序对 + 归并排序
  6. Django简单操作
  7. QT 信号槽 异步事件驱动 单线程 多并发
  8. BZOJ 3143 Luogu P3232 [HNOI2013]游走 (DP、高斯消元)
  9. 双重Iterator 报错!!!!
  10. 基本的axios用法