Loading

摘要: ILookup是数据结构的一种,Lookup继承于它,终极父类也是 IEnumerable,能使用Linq的所有方法,Ilookup是字典的升级版本,最适合最 一对多的使用场景,可以使用索引,下面是一个应用场景,省对应多个地级市 关系 { (var itearea, _) = es.GetTCInf 阅读全文
posted @ 2019-11-09 22:49 大意了啊 阅读(501) 评论(0) 推荐(0) 编辑
摘要: *1:NetCore的上下文,自行封装一个全局静态 HttpContextHelper *2:读取Json的配置文件 { // IConfiguration Configuration 得注入,二级节点的访问,用冒号 .GetSection("AppSettings:" + name) Config 阅读全文
posted @ 2019-11-09 22:44 大意了啊 阅读(971) 评论(0) 推荐(0) 编辑
摘要: 前端 // 获取生成的token,直接这样写也是可以的 function gettoken() { var token = '@Html.AntiForgeryToken()'; return $(token).val(); } //某button的单击事件 function tijiao() { 阅读全文
posted @ 2019-11-09 22:37 大意了啊 阅读(1135) 评论(0) 推荐(0) 编辑
摘要: 都知道在MVC5中,在action方法前加入 [ValidateAntiForgeryToken],会验证是否来自于自己表单的用户,验证其cook的token和来自表单中的token,是否一致为方便更好的调试,直接调用其验证方法 AntiForgery.Validate(); // [AcceptV 阅读全文
posted @ 2019-11-09 22:04 大意了啊 阅读(473) 评论(0) 推荐(0) 编辑
摘要: 1.在Core2.2 Startup 中,Configure 方法写入中间件,app.Use public void Configure(IApplicationBuilder app, IHostingEnvironment env) { #region Middleware app.Use(ne 阅读全文
posted @ 2019-11-09 21:33 大意了啊 阅读(472) 评论(0) 推荐(1) 编辑