04 2015 档案

摘要:LINQ (Language-INtegrated Query)Programmers perform every day is finding and retrieving (存取) objects in memory, a database, or an XML file. SQL(relati... 阅读全文
posted @ 2015-04-26 14:53 郭松 阅读(238) 评论(1) 推荐(0)
摘要:Async 方法有三种可能的返回类型: Task、Task 和 void,但是 async 方法的固有返回类型只有 Task 和 Task。 当从同步转换为异步代码时,任何返回类型 T 的方法都会成为返回 Task 的 async 方法,任何返回 void 的方法都会成为返回 Task 的 asyn... 阅读全文
posted @ 2015-04-19 22:50 郭松 阅读(173) 评论(0) 推荐(0)
摘要:使用Regex类需要引用命名空间:using System.Text.RegularExpressions;利用Regex类实现验证示例1:注释的代码所起的作用是相同的,不过一个是静态方法,一个是实例方法var source = "abcdefg"; //Regex regex = new Rege... 阅读全文
posted @ 2015-04-19 21:47 郭松 阅读(134) 评论(0) 推荐(0)
摘要:Strings: immutable(不可变)的unicode字符序列。string s1 = "One Two Three Four";string sx = (string)s1.Clone(); //s1复制到sxConsole.WriteLine(Object.ReferenceEquals... 阅读全文
posted @ 2015-04-19 21:23 郭松 阅读(132) 评论(0) 推荐(0)
摘要:Initializing Array Elements int[] myIntArray = new int[5] { 2, 4, 6, 8, 10 }; // longer syntax int[] myIntArray = { 2, 4, 6, 8, 10 }; ... 阅读全文
posted @ 2015-04-07 18:44 郭松 阅读(326) 评论(0) 推荐(0)
摘要:An interface is a contract(协定) that guarantees to a client how a class or struct will behave.When a class implements an interface(实现一个接口), it tells an... 阅读全文
posted @ 2015-04-07 18:38 郭松 阅读(162) 评论(0) 推荐(0)
摘要:与类密切相关的几个特征便是继承,多态和封装了,继承inheritanceThe specialization relationship is typically implemented using inheritance.Polymorphism(多态): There are two powerfu... 阅读全文
posted @ 2015-04-07 12:50 郭松 阅读(113) 评论(0) 推荐(0)