随笔分类 -  .netMVC

摘要:IPHelper.cs 阅读全文
posted @ 2018-11-07 17:50 by-lhc 阅读(739) 评论(0) 推荐(0)
摘要:一、在mvc项目根目录下建 App_Code 文件夹,在该文件夹下建 Common 公用方法视图 Common.cshtml 如下图: 二、视图方法的使用 如下如: 阅读全文
posted @ 2018-10-30 17:19 by-lhc 阅读(754) 评论(0) 推荐(0)
摘要:一、在mvc项目根目录下建 App_Code 文件夹,在该文件夹下建 UIHelper 类 UIHelper.cs 二、扩展方法的使用 如下图: 阅读全文
posted @ 2018-10-30 17:03 by-lhc 阅读(481) 评论(1) 推荐(1)
摘要:一、过滤标签类 AuthorityFilterAttribute.cs 二、在 MVC 项目的 App_Start 文件夹下,找到 FilterConfig.cs 文件,添加过滤标签 如下图: 阅读全文
posted @ 2018-10-29 10:48 by-lhc 阅读(477) 评论(0) 推荐(0)
摘要:一、创建切面类 引用圈起来的2个类库,从nuget里面找。 ApiClientAttribute.cs 二、切面类的使用 DefaultClient.cs 阅读全文
posted @ 2018-10-09 14:50 by-lhc 阅读(405) 评论(0) 推荐(0)
摘要:一、创建实体类、实体类工厂 ReturnMsg.cs ReturnMsgFac.cs 二、创建切面类 引用圈起来的4个类库,框架没有的就从nuget里面找。 APIInitAttribute.cs 三、切面类的使用 DefaultController.cs 阅读全文
posted @ 2018-10-08 15:59 by-lhc 阅读(368) 评论(0) 推荐(0)
摘要:1.存储过程 数据库函数exec()执行sql字符串有“sql注入风险”,不推荐使用! 2.调用存储过程的方法 阅读全文
posted @ 2018-04-24 09:48 by-lhc 阅读(1349) 评论(0) 推荐(0)
摘要:1.AppSettingExtension类的实现 2.配置文件示例(@"~/App_Data/AppSettingsConfig.xml") 阅读全文
posted @ 2018-04-11 18:46 by-lhc 阅读(3550) 评论(0) 推荐(0)
摘要:Web.config file: <?xml version="1.0" encoding="utf-8"?><configuration><appSettings configSource="Config\app.config"></appSettings></configuration> Ps. 阅读全文
posted @ 2018-04-11 17:28 by-lhc 阅读(215) 评论(0) 推荐(0)