随笔分类 -  C#

c#
摘要:1.移位实现 2.GetHashCode() 阅读全文
posted @ 2017-04-06 15:06 b̶i̶n̶g̶.̶ 阅读(1117) 评论(1) 推荐(0) 编辑
摘要:参考资料: 1. http://www.cnblogs.com/heyuquan/archive/2013/04/18/3028044.html 阅读全文
posted @ 2017-02-23 15:04 b̶i̶n̶g̶.̶ 阅读(188) 评论(0) 推荐(0) 编辑
摘要:1 public class TAjaxListLoginValidateAttribute : FilterAttribute, IAuthorizationFilter 2 { 3 public void OnAuthorization(AuthorizationContext filterContext) 4 { 5 ... 阅读全文
posted @ 2016-12-15 10:15 b̶i̶n̶g̶.̶ 阅读(416) 评论(0) 推荐(0) 编辑
摘要:参考:https://blogs.msdn.microsoft.com/pfxteam/2009/06/02/the-nature-of-taskcompletionsourcetresult/ 阅读全文
posted @ 2016-12-01 12:14 b̶i̶n̶g̶.̶ 阅读(243) 评论(0) 推荐(0) 编辑
摘要:参考:https://blogs.msdn.microsoft.com/windowsappdev_cn/2012/04/30/winrt-await/ 阅读全文
posted @ 2016-12-01 10:03 b̶i̶n̶g̶.̶ 阅读(137) 评论(0) 推荐(0) 编辑
摘要:public class Adapter { static Func, Task> _owinApp; /// /// 默认构造函数 /// public Adapter() { var builder = new AppBuilder(); ... 阅读全文
posted @ 2016-11-24 14:48 b̶i̶n̶g̶.̶ 阅读(215) 评论(0) 推荐(0) 编辑
摘要:/// /// Autofac容器 /// public class AutofacContainer { public static IContainer Container { get; private set; } public static void Set(IContainer c) { ... 阅读全文
posted @ 2016-11-15 10:11 b̶i̶n̶g̶.̶ 阅读(257) 评论(0) 推荐(0) 编辑
摘要:一、在App.config中自定义Section,这个使用了SectionGroup xml中的section 需要显示配置自定义的处理程序,即type属性二、创建处理程序 MySectionHandler 执行处理程序代码如下: 注意事项: 1.获取自定义Section,如果是SectionGro 阅读全文
posted @ 2016-11-09 17:16 b̶i̶n̶g̶.̶ 阅读(2008) 评论(0) 推荐(0) 编辑
摘要:1.BlockCollection集合是一个拥有阻塞功能的集合,它就是完成了经典生产者消费者的算法功能。 它没有实现底层的存储结构,而是使用了IProducerConsumerCollection接口的几个集合作为底层数据接结构,例如:ConcurrentBag、ConcurrentStack、Co 阅读全文
posted @ 2016-10-28 15:36 b̶i̶n̶g̶.̶ 阅读(1570) 评论(0) 推荐(0) 编辑
摘要:资料:http://www.cnblogs.com/chengxiaohui/articles/5672768.html 阅读全文
posted @ 2016-10-28 13:59 b̶i̶n̶g̶.̶ 阅读(334) 评论(0) 推荐(0) 编辑
摘要:/// /// Cors扩展 /// public static class IPipelinesExtensions { /// /// CORS Enable /// /// pipelines public static void UserCors(this IP... 阅读全文
posted @ 2016-08-31 13:19 b̶i̶n̶g̶.̶ 阅读(576) 评论(0) 推荐(0) 编辑
摘要:1.App.config 2.根目录下quartz_jobs.xml,需调始终复制 3.Cron表达式范例 阅读全文
posted @ 2016-08-23 09:44 b̶i̶n̶g̶.̶ 阅读(3722) 评论(1) 推荐(0) 编辑
摘要:备注: mongodb for C# SDK版本:1.11(可支持mongodb 3.2版本) mongodb版本:3.0.6 阅读全文
posted @ 2016-07-13 15:14 b̶i̶n̶g̶.̶ 阅读(1978) 评论(0) 推荐(0) 编辑
摘要:阅读1:http://blog.csdn.net/nacl025/article/details/9163495 阅读2:http://www.cnblogs.com/x-xk/archive/2013/06/05/3118005.html 阅读3:http://www.cnblogs.com/je 阅读全文
posted @ 2016-06-01 17:15 b̶i̶n̶g̶.̶ 阅读(433) 评论(1) 推荐(0) 编辑
摘要:var num = TCalcPager.CalcPageCount(addList.Count, TDefautValue.PageSize); for (int i = 0; i < num; i++) { var resul... 阅读全文
posted @ 2016-05-31 15:47 b̶i̶n̶g̶.̶ 阅读(146) 评论(1) 推荐(0) 编辑
摘要:1.带协议表达式 var pattern = @"[(?<=http://)|(?<=https://)]+[\w\.]+[^/?#]"; 2.不带协议表达式 var pattern = @"((?<=http://)|(?<=https://))[\w\.]+[^/?#]"; 阅读全文
posted @ 2016-04-21 09:36 b̶i̶n̶g̶.̶ 阅读(279) 评论(0) 推荐(0) 编辑
摘要:链接:http://www.cnblogs.com/royding/p/3919134.html 阅读全文
posted @ 2016-04-19 17:00 b̶i̶n̶g̶.̶ 阅读(125) 评论(0) 推荐(0) 编辑
摘要:情景一中,我主要介绍了用于解决资源争用时各种方式的区别,本篇文章我们将进一步介绍线程同步的第二种场景。 情景二:数量有限,先到先得 情景简介:与情景一类似,但是这次茅坑的数量不只一个。如果有需求的人数少于茅坑数量,那一切都很和谐。但是人数超过茅坑数量的时候该怎么办?多个人占用一个坑? 解决办法:当所 阅读全文
posted @ 2016-04-15 17:05 b̶i̶n̶g̶.̶ 阅读(166) 评论(0) 推荐(0) 编辑
摘要:从本篇文章开始,我将陆续介绍多线程中会遇到的三种情况。 情景一:此茅坑有主了 大锤:“我擦,居然一个茅坑有两个人在用。” 大锤:“啊,忍不住了,一起挤挤吧~~~” 叫兽:“舒坦了,先走了。” 叫兽按下了冲水开关.... "哗啦啦....." 大锤:“你妹啊,冲什么水啊,冲得我一身 shit ” 解决 阅读全文
posted @ 2016-04-15 17:02 b̶i̶n̶g̶.̶ 阅读(196) 评论(0) 推荐(0) 编辑
摘要:C# 已经提供了我们几种非常好用的类库如 BackgroundWorker、Thread、Task等,借助它们,我们就能够分分钟编写出一个多线程的应用程序。 比如这样一个需求:有一个 Winform 窗体,点击按钮后,会将窗体中的数据导出到一个 output.pdf 文件中。原先的代码没有采用多线程 阅读全文
posted @ 2016-04-15 16:59 b̶i̶n̶g̶.̶ 阅读(143) 评论(0) 推荐(0) 编辑