给定以下代码:
if (!string.IsNullOrEmpty(link1))
{
string[] link1_ar = link1.Split(sep, StringSplitOptions.None);
string page1 = link1_ar[1];
string filter1 = link1_ar[2];
string code2 = link2_ar[3];
MyMethod(summary, page1, filter1, code1);
}
if (!string.IsNullOrEmpty(link2))
{
string[] link2_ar = link2.Split(sep, StringSplitOptions.None);
string page2 = link2_ar[1];
string filter2 = link2_ar[2];
string code2 = link2_ar[3];
MyMethod(summary, page2, filter2, code2);
}
if (!string.IsNullOrEmpty(link3))
{
string[] link3_ar = link3.Split(sep, StringSplitOptions.None);
string page3 = link3_ar[1];
string filter3 = link3_ar[2];
string code3 = link3_ar[3];
MyMethod(summary, page3, filter3, code3);
}
private void MyMethod(ref string summary, string bid_page, string bid_filter, string bid_code, string bid_silver)
{
bla bla bla
}
我想同时运行三个 MyMethod!
为了达到这个目的,我应该在这些代码中进行哪些更改?