摘要:
通常情况下都是使用 application/json发起post请求,但是有的.net 接口只接收 application/x-www-form-urlencoded 例如: 需改为 name=张三&results[0][score]=88&results[0][subject]=语文方式 对常规的 阅读全文
摘要:
show OPEN TABLES where In_use > 0; -- 查询是否锁表show processlist; -- 查询到相对应的进程 然后killidSELECT * FROM INFORMATION_SCHEMA.innodb_trx; -- 当前运行的所有事务 SELECT * 阅读全文
摘要:
public static T MapTo<T>(this object obj) { if (obj == null) return default(T); Mapper.CreateMap(obj.GetType(), typeof(T)); return Mapper.Map<T>(obj); 阅读全文
摘要:
var statusSelectItems = new List { new SelectListItem{Text="失联",Value="0"}, new SelectListItem{Text="正常",Value="1"}, new SelectListItem{Text="维修",Value="2"}, new SelectListItem{Text="... 阅读全文
摘要:
//通过value获取枚举对象 foreach (RoleType suit in Enum.GetValues(typeof(RoleType))) { //循环遍历枚举 } InquiryOrderStatus enu = new InquiryOrderStatus(); Enum.TryParse(status.ToString(), out enu); 阅读全文
摘要:
[jQuery]Ajax实现跨域访问JSON [jQuery]Ajax实现跨域访问JSON Ajax跨域访问JSON 环境:.net4.0+jQuery+JSON.net 因为在跨域实现,所以这里新建网站,这个网站只需要Ashx文件 public void ProcessRequest(HttpCo 阅读全文
摘要:
protected override void OnException(ExceptionContext filterContext) { // 此处进行异常记录,可以记录到数据库或文本,也可以使用其他日志记录组件。 // 通过filterContext.Exception来获取这个异常。 f... 阅读全文
摘要:
/// /// 获取域名的顶级域名 /// /// /// public static string GetTopDomainName(string domain) { //https://www.safsd.asdfasdf.baidu.com.cn/ssssd... 阅读全文
摘要:
dynamic是Framework4.0的新特性,dynamic的出现让C#具有了弱语言类型的特性,编译器在编译的时候,不再对类型进行检查,不会报错,但是运行时如果执行的是不存在的属性或者方法,运行程序还是会抛出RuntimeBinderException异常。 var 与 dynamic 的区别 阅读全文
摘要:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace... 阅读全文