摘要: 上面代码调用this方法的代码是 function onset(obj) { alert(obj); //[object HTMLInputElement] alert($(obj).attr("href")); //# alert($(obj).parent().attr("id")) // ZZ 阅读全文
posted @ 2017-06-26 11:07 段十八丶 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 这个方法还有点不太完善,个人觉得或许可能有更好的办法。 但是现在还不知道,看到这种留个记录。 首先在项目根目录创建文件夹Filter 然后创建BasicAuthAttribute.cs 类文件 代码如下: 继承于ActionFilterAttribute,而后调用的时候在项目的控制器以特性的方式来使 阅读全文
posted @ 2017-06-25 23:00 段十八丶 阅读(168) 评论(0) 推荐(0) 编辑
摘要: string IP = HttpContext.Request != null ? HttpContext.Request.UserHostAddress : "127.0.0.1"; 注:这玩意你在VS上运行LocalHost 不好用,返回的一定是 "::1" 但是放到IIS上应该就好使多了。 阅读全文
posted @ 2017-06-13 16:59 段十八丶 阅读(239) 评论(0) 推荐(0) 编辑
摘要: public ActionResult GetData() { string data = Request.Form["Data"] ?? ""; using (var db = new BaseContext()) { SqlConnection conn = new System.Data.SqlClient.SqlConnection(); //conn.ConnectionString ... 阅读全文
posted @ 2017-06-13 10:35 段十八丶 阅读(3489) 评论(0) 推荐(0) 编辑
摘要: 1 Person p = new Person(); 2 p.Id = 1; 3 p.Name = "张三"; 4 p.Sex = "男"; 5 p.Weight = 65; 6 p.Height = 180; 7 p.Birthday = DateTime.Now; 8 9 List<Person 阅读全文
posted @ 2017-06-08 14:25 段十八丶 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 64 位 Visual Basic for Applications 概述Microsoft Visual Basic for Applications (VBA) 是 Microsoft Office 附带的 Visual Basic 版本。在 Microsoft Office 2010 中,VB 阅读全文
posted @ 2017-06-07 18:59 段十八丶 阅读(8402) 评论(0) 推荐(0) 编辑
摘要: public string StringToUnicode(string str) { string outStr = ""; if (!string.IsNullOrEmpty(str)) { for (int i = 0; i < str.Length; i++) ... 阅读全文
posted @ 2017-06-06 15:46 段十八丶 阅读(3823) 评论(0) 推荐(0) 编辑
摘要: 折腾了我六个小时,感觉自己智商下降的不行。 一个哥们给我提了提说 EF 一定是先查后改,然后SaveChanges(); 我是在登陆成功后修改密码操纵中,第一次修改没问题,第二次就会出现这种情况。 翻来覆去想不出 为什么。 public ActionResult EditPwd() { BaseUs 阅读全文
posted @ 2017-06-05 14:02 段十八丶 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 个人用的比较多的表单提交方法 阅读全文
posted @ 2017-05-31 23:55 段十八丶 阅读(200) 评论(0) 推荐(0) 编辑