摘要: 1.abstract 可以修饰类和方法,修饰方法时只声明不实现; 2.继承实现abstract类必须通过override实现abstract声明的方法,而virtual方法可选择override(重写)实现; 3. 阅读全文
posted @ 2016-10-05 12:36 FredGrit 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 1.abstract 可以修饰类和方法,修饰方法时只声明不实现; 2.继承实现abstract类必须通过override实现abstract声明的方法,而virtual方法可选择override(重写)实现; 3. 阅读全文
posted @ 2016-10-05 12:35 FredGrit 阅读(157) 评论(0) 推荐(0) 编辑
摘要: string sourcePath = @"D:\GL\20160826141915999999.txt"; for (int i = 0; i < 10; i++) { Guid guid = Guid.NewGuid(); string str = DateTime.Now.ToString(" 阅读全文
posted @ 2016-08-26 15:09 FredGrit 阅读(4864) 评论(0) 推荐(0) 编辑
摘要: 1取汉字汉语拼音首字母: private static string GetFirstLetterOfChineseString(string CnChar) { long iCnChar; byte[] ZW = System.Text.Encoding.Default.GetBytes(CnCh 阅读全文
posted @ 2016-08-23 14:29 FredGrit 阅读(1486) 评论(0) 推荐(0) 编辑
摘要: Task<string> task = Task.Factory.StartNew(() => "The world is very fair and everything depend on myself!"); Console.WriteLine(task.Result); Task<long> 阅读全文
posted @ 2016-08-17 23:07 FredGrit 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 1. Task task = new Task(() => { MultiplyMethod(a, b); }); task.Start(); 2. Task task = Task.Run(() => { MultiplyMethod(a, b); }); 3. Task task = Task. 阅读全文
posted @ 2016-08-17 22:54 FredGrit 阅读(2915) 评论(0) 推荐(0) 编辑
摘要: class Program { static void Main(string[] args) { (new Program()).MyMethodAsync(); Console.ReadLine(); } public async Task MyMethodAsync() { Task<int> 阅读全文
posted @ 2016-08-17 22:31 FredGrit 阅读(127) 评论(0) 推荐(0) 编辑
摘要: static int BinarySearch(int[] arr,int key,int low,int high) { low = 0;high = arr.Length - 1; while(low<=high) { int mid = (low + high) / 2; if (arr[mi 阅读全文
posted @ 2016-08-16 21:13 FredGrit 阅读(533) 评论(0) 推荐(0) 编辑
摘要: 1.Task.Run(); static void Main(string[] args) { long a = 9876545678, b = 987654567892; Task task = Task.Run(() => { Add(a, b); }); Console.ReadLine(); 阅读全文
posted @ 2016-08-15 22:43 FredGrit 阅读(184) 评论(0) 推荐(0) 编辑
摘要: private void btnExport_Click(object sender, RoutedEventArgs e) { System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); sw.Start(); dg. 阅读全文
posted @ 2016-08-15 22:22 FredGrit 阅读(707) 评论(0) 推荐(0) 编辑