02 2019 档案
摘要:Autofac配置 using Autofac; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Web; using System.We
阅读全文
摘要:可能有些时候需要记录Action的执行时间来优化系统功能,这时可以用过滤器来实现 第1个例子 using System; using System.Diagnostics; using System.Net.Http; using System.Threading; using System.Thr
阅读全文
摘要:引用 Newtonsoft.Json // Post请求 public string PostResponse(string url,string postData,out string statusCode) { string result = string.Empty; //设置Http的正文
阅读全文
摘要:解决办法有两种:第一种:使用对象的字段属性设置JsonProperty来实现(不推荐,因为需要手动的修改每个字段的属性) public class UserInfo { [JsonProperty("id")] public int Id{ set; get; } [JsonProperty("us
阅读全文
摘要:Razor 将C#对象转换成Javascript对象 在Razor中使用Json字符串,特殊字符被自动转义(如:\"->") ViewBag.Data = list; <script type="text/javascript"> //将数据对象转换为 JSON 格式,是为了在网页中通过使
阅读全文