4
我正在嘗試爲matchcollection創建一個Parallel.Foreach循環。 這是在我建造的刮板。 我只需要知道要放什麼東西在Parallel.ForeachMatchcollection Parallel.Foreach
MatchCollection m = Regex.Matches(htmlcon, matchlink, RegexOptions.Singleline);
Parallel.ForEach(WHAT DO I PUT HERE? =>
{
Get(match.Groups[1].Value, false);
Match fname = Regex.Match(htmlcon, @"<span class=""given-name"(.*?)</span>", RegexOptions.Singleline);
Match lname = Regex.Match(htmlcon, @"span class=""family-name"">(.*?)</span>", RegexOptions.Singleline);
firstname = fname.Groups[1].Value;
lastname = lname.Groups[1].Value;
sw.WriteLine(firstname + "," + lastname);
sw.Flush();
}):
我想:
Parallel.ForEach<MatchCollection>(m,match =>
,但沒有運氣!
在此先感謝! :)