这是我的代码
try
{
for (int i = 0; i < RichTextbox2.Lines.Length; i++)
{
var length = urlwebapi.Lines.Length;
{
WebClient f = new WebClient();
dynamic read = f.DownloadString(urlwebapi.Lines[(i % length)] + RichTextbox2.Lines[i]);
JObject o = JObject.Parse(read);
}
}
}
catch (WebException e)
{
MessageBox.Show(e.Message);
}
MessageBox.Show("done");
示例 urlwebapi
http://example1.com/api.php?ex=
http://example2.com/api.php?ex=
http://example3.com/api.php?ex=
http://example4.com/api.php?ex=
http://example5.com/api.php?ex=
该代码只能在一个urlwebapi上同时运行一个。执行代码时如何获得然后立即同时运行最多 5 个urlwebapi(example1.com 直到 example5.com)