12 2017 档案

摘要:集合 r 是 IEnumerable<T> 类型,该类型的对象具有延迟加载的特性,也就是说, IEnumerable<Student> r = ssList.Where(w => w.StudentID > 2); 这句代码执行后, r 中并没有值,只有当 r 使用时,也就是上述代码中的 ToLis 阅读全文
posted @ 2017-12-31 17:52 热敷哥 阅读(176) 评论(0) 推荐(0)
摘要:IList s1 = new List() { "One", "Two", "Three", "Two", "Three", "wjire" }; IList s2 = new List() { "www", "Tssswo", "Three" }; //从 s1 中删除 s1,s2 都有的元素,... 阅读全文
posted @ 2017-12-31 17:01 热敷哥 阅读(319) 评论(0) 推荐(0)
摘要:var c1 = Enumerable.Empty();//c1.Count=0 var rlist = Enumerable.Range(9527, 10);//{9527,9528,9529,......9536} var rrlist = Enumerable.Repeat(9527, 10);//{9527,9527... 阅读全文
posted @ 2017-12-31 13:14 热敷哥 阅读(161) 评论(0) 推荐(0)
摘要:原来还有这种写法,自己还记了笔记的.悲哀! 一直以来,我都是这样写的: 哎,悲哀! Union 和 Concat 不一样的地方是它要去重 阅读全文
posted @ 2017-12-30 21:13 热敷哥 阅读(683) 评论(0) 推荐(0)
摘要:检查元素的数量,每个元素的值及两个集合中元素的顺序是否相等,3个方面都相等则为true,否则为false 阅读全文
posted @ 2017-12-30 21:08 热敷哥 阅读(498) 评论(0) 推荐(0)
摘要:IList intList = new List() { 10, 21, 30, 45, 50, 87 }; var sum1 = intList.Sum(s => { if (s % 2 == 0) { return s; ... 阅读全文
posted @ 2017-12-30 20:49 热敷哥 阅读(338) 评论(0) 推荐(0)
摘要:IList<Student> studentList = new List<Student>() { new Student() { StudentID = 1, StudentName = "John", StandardID =1 }, new Student() { StudentID = 2 阅读全文
posted @ 2017-12-30 18:43 热敷哥 阅读(157) 评论(0) 推荐(0)
摘要:Contains Max 阅读全文
posted @ 2017-12-30 18:14 热敷哥 阅读(225) 评论(0) 推荐(0)
摘要:示例一 示例二 阅读全文
posted @ 2017-12-30 18:01 热敷哥 阅读(180) 评论(0) 推荐(0)
摘要:1.判断 checkbox 和 radio 是否选中 if($("标签选择器").is(":checked")) 2.改变 checkbox 选中状态 .prop("checked", false); .prop("checked", true); 如果使用过 .removeAttr("checke 阅读全文
posted @ 2017-12-24 12:36 热敷哥 阅读(168) 评论(0) 推荐(0)
摘要:一般有两种办法 第一种handler.UseCookies=true(默认为true),默认的会自己带上cookies,例如 这种情况post请求登陆成功后,重定向到别的页面,也会自动带上cookies。如果把handler.UseCookies设置为false,登陆后重定向的话不会自动带上cook 阅读全文
posted @ 2017-12-18 22:45 热敷哥 阅读(12953) 评论(2) 推荐(0)
摘要:1.获取 post 请求 body 内容 [HttpPost] public string GetId() { //如果方法参数里面有 [FromBody],则需要重新调整内容指针,再进行读取。 //Request.Content.ReadAsStreamAsync().Result.Seek(0,System.IO.SeekOrigin.Begin); string conten... 阅读全文
posted @ 2017-12-17 20:48 热敷哥 阅读(921) 评论(0) 推荐(0)