runliuv

runliuv@cnblogs

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2021年12月23日

摘要: 重点是拿到HttpContext 对象。 先从Headers["Cdn-Src-Ip"] 中取IP,其次从Headers["X-Forwarded-For"] 取,最后从context.Connection.RemoteIpAddress 中取。 有可能遇到“::ffff:192.168.2.131 阅读全文
posted @ 2021-12-23 17:23 runliuv 阅读(3564) 评论(0) 推荐(2) 编辑

摘要: C#.NET FRAMEWORK ASP.NET MVC 获取客户端IP 工具类: using System; namespace CommonUtils { public static class ClientIpUtil { public static string GetClientIpMvc 阅读全文
posted @ 2021-12-23 16:24 runliuv 阅读(404) 评论(0) 推荐(0) 编辑

摘要: 使用NPOI导入.xlsx遇到“EOF in header”报错,网上找好很多方法,没解决,最后换成EPPlus.Core导入。 导出默认是.xls。 NPOI 操作类: using NPOI.HPSF; using NPOI.HSSF.UserModel; using NPOI.SS.UserMo 阅读全文
posted @ 2021-12-23 11:16 runliuv 阅读(4345) 评论(0) 推荐(2) 编辑