摘要: 参考:http://www.cnblogs.com/scy251147/archive/2013/01/04/2843875.html static void TaskWithCancellation() { var cancellationTokenSource = new CancellationTokenSource(); var cancellationTo... 阅读全文
posted @ 2015-05-22 18:03 _DN 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 1.Task多线程简单模板 using System; using System.Collections.Generic; using System.Threading.Tasks; namespace Exercises { public class GroupInfo { public stri 阅读全文
posted @ 2015-05-22 18:00 _DN 阅读(354) 评论(0) 推荐(0) 编辑
摘要: 1.另一应用程序已使用 HTTP.SYS 注册了该 URL 在做WCF wsDualHttpBinding的时候,调试时会出现此异常。 其意思为:有一个Host已经启动了,占用了指定的端口了。 只要保证启动一个Host,就不会出现这样的提示了! 2.没有终结点在侦听可以接受消息的 连接不上服务器:没有终结点在侦听可以接受消息的 http://localhost:8733/imc... 阅读全文
posted @ 2015-05-22 16:44 _DN 阅读(269) 评论(0) 推荐(0) 编辑
摘要: Close不一定会成功,所以需要Abort。 ChannelFactory channel = new ChannelFactory("bindingName"); IService1 client = channel.CreateChannel(); try { client.Say("Hello, world!"); client.Close(); } cat... 阅读全文
posted @ 2015-05-22 16:18 _DN 阅读(259) 评论(0) 推荐(0) 编辑
摘要: inner join 模板: var query = from x in db.T1 join y in db.T2 on x.Id equals y.Id select x; left join模板: var query = from x in db.T1 join y in db.T2 ... 阅读全文
posted @ 2015-05-22 15:38 _DN 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 如帖:http://www.cnblogs.com/liuxianan/archive/2013/04/13/3018732.html http://www.cnblogs.com/default/archive/2012/06/05/2537225.html 样例代码: [Test] public void GetItemTest() { var token ... 阅读全文
posted @ 2015-05-22 15:16 _DN 阅读(151) 评论(0) 推荐(0) 编辑