using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Net;using System.Text;using System.Threading.Tasks;namesp...
.NET4定义了8个Tuple类,和一个静态Tuple类---------------------------------------------------------------------返回多个值usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Threading.Tasks;
namespaceConsoleApplication..
分类:
Web程序 时间:
2014-07-28 16:50:44
阅读次数:
233
1 start: 2 3 System.Threading.RegisteredWaitHandle rhw = null; 4 new Action(() => 5 { 6 for (var...
分类:
编程语言 时间:
2014-07-26 17:08:12
阅读次数:
311
在C#中,赋值和简单的数字运算都不是原子型操作。在多线程环境下,会产生数据安全的问题。在多线程环境下,我们可以通过使用System.Threading.Interlocked类来实现原子型操作当个数据,使用它比使用Monitor类跟简单。Interlocked类主要方法方法作用CompareExchange()安全比较两..
分类:
其他好文 时间:
2014-07-26 15:34:55
阅读次数:
225
=================================================简单的实现IEnumerable接口------------------------------------Person.csusingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Threading.Tasks;
usingSystem.Collections;
na..
分类:
其他好文 时间:
2014-07-25 11:36:32
阅读次数:
200
通过一个例子来看-------------------------------------------------------Student.csusingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Threading.Tasks;
usingSystem.Collections;
namespaceConsoleApplication6
{
publiccla..
分类:
其他好文 时间:
2014-07-25 11:36:22
阅读次数:
214
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace linq_to_xml
{
internal class Program
...
分类:
其他好文 时间:
2014-07-24 12:23:55
阅读次数:
186
yieldreturn语句返回集合的一个元素yieldbreak可停止迭代------------------------------------------------------------------Student.csusingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Threading.Tasks;
namespaceConsoleA..
分类:
其他好文 时间:
2014-07-24 10:52:36
阅读次数:
204
-----------------------------------------ListStu.csusingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Threading.Tasks;
usingSystem.Collections;
namespaceConsoleApplication3
{
publicclassListStu<T>
{
privateQu..
分类:
其他好文 时间:
2014-07-24 10:51:54
阅读次数:
228
.NET异步编程之新利器——Task与Await、Async一.FrameWork 4.0之前的线程世界 在.NET FrameWork 4.0之前,如果我们使用线程。一般有以下几种方式:使用System.Threading.Thread 类,调用实例方法Start()开启一个新线程,调用...
分类:
Web程序 时间:
2014-07-23 16:33:41
阅读次数:
398