2018年1月11日

async 和 await 的用法示例

摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading; namespace ConsoleApp2 { class Program { st... 阅读全文

posted @ 2018-01-11 15:31 方辰 阅读(201) 评论(0) 推荐(0) 编辑

2018年1月9日

COM线程模型的行为

摘要: 原文:https://msdn.microsoft.com/library/ms809971.aspx Behavior of the COM Threading Models COM线程模型的行为 Before any thread can create or manipulate COM obj 阅读全文

posted @ 2018-01-09 20:32 方辰 阅读(114) 评论(0) 推荐(0) 编辑

2018年1月8日

WCF DEMO2 基于HTTP-GET的元数据交换及Configure()方法以及添加MEX终结点

摘要: using System; using System.Diagnostics; using System.Linq; using System.ServiceModel; using System.ServiceModel.Channels; using System.ServiceModel.Description; class Program { static v... 阅读全文

posted @ 2018-01-08 13:57 方辰 阅读(297) 评论(1) 推荐(1) 编辑

WCF DEMO1 创建自托管宿主

摘要: using System; using System.ServiceModel; using System.ServiceModel.Channels; //注意:需要引用程序集 System.ServiceModel 并在管理员模式下运行 class Program { static void Main(string[] args) { ... 阅读全文

posted @ 2018-01-08 12:17 方辰 阅读(381) 评论(1) 推荐(0) 编辑

2017年12月31日

构造用于1个方法在多线程环境下重复多次执行测试的通用方法 C#

摘要: static void MultithreadsCycleTestWithSameMethod(int threadNumber, int cycleNumber, ThreadStart action) { Console.WriteLine("Begin"); var threads = new Thread[t... 阅读全文

posted @ 2017-12-31 14:57 方辰 阅读(348) 评论(0) 推荐(0) 编辑

2017年12月28日

用于深拷贝的扩展方法 C#

摘要: using System.Runtime.Serialization.Formatters.Binary; using System.IO; public static class Tool { public static T DeepCopy(this T obj) { BinaryFormatter formatter... 阅读全文

posted @ 2017-12-28 13:43 方辰 阅读(134) 评论(0) 推荐(0) 编辑

实现泛型数组的冒泡排序算法 C#

摘要: public static class BubbleSortTool { public static void BubbleSort(this T[] array, AscendingorDescending ascendingorDescending) where T:IComparable { switch (ascending... 阅读全文

posted @ 2017-12-28 13:32 方辰 阅读(486) 评论(0) 推荐(0) 编辑

导航