echo ""; echo ""; echo ""; echo ""; if(!is_admin){echo "";} » 2011 » July 仲子说

欢迎您光临我的个人网站!


2011-07-13

C#中简单的多线程调用

Posted in .NET at 10:41 by 仲远

标签:
Zhongyuan Wang

97100fe403b8

????????????????????????????????????????????????????????.NET Framewrok 4?????Parallel.For?Parallel.Foreach???????????????????????????????????
List<string> lines = GetLines(); //get the set of elements
Parallel.ForEach<string>(lines, line =>
{
string[] fields = line.Split(new char[] { ‘\t’ });
//Do something with the element: line
});
???????lines????????????list??????collection?Parallel.ForEach<string>????????string??...查看全文