2012年7月12日

asynChronous delegaTes 异步委托

摘要: static int TakesAWhile(int data, int ms) { Console.WriteLine("TakesAWhile started"); Thread.Sleep(ms); Console.WriteLine("TakesAWhile completed"); return ++data; } ... 阅读全文

posted @ 2012-07-12 16:56 GIS-MAN 阅读(139) 评论(0) 推荐(0) 编辑

正则表达式基础 之 ?

摘要: Console.WriteLine (Regex.Match ("color", @"colou?r").Success); // True Console.WriteLine (Regex.Match ("colour", @"colou?r").Success); // True Console.WriteLine (Regex.Match ("colouur", @"... 阅读全文

posted @ 2012-07-12 16:56 GIS-MAN 阅读(156) 评论(0) 推荐(0) 编辑

线程不安全

摘要: class ThreadUnsafe { static int _val1 = 1, _val2 = 1; static void Go() { if (_val2 != 0) Console.WriteLine (_val1 / _val2); _val2 = 0; } }///方法的定义和分配的内存地... 阅读全文

posted @ 2012-07-12 16:55 GIS-MAN 阅读(157) 评论(0) 推荐(0) 编辑

导航