![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
List<DataRow> id1 = new List<DataRow>(); List<DataRow> id2 = new List<DataRow>(); List<DataRow> id3 = new List<DataRow>(); List<DataRow> id4 = new List<DataRow>(); List<DataRow> id5 = new List<DataRow>(); if (nresult.Rows.Count > 0) { ExpressCount = nresult.Rows.Count; for (int i = 0; i < nresult.Rows.Count; i++) { int a = i % 5; switch (a) { case 0: id1.Add(nresult.Rows[i]); break; case 1: id2.Add(nresult.Rows[i]); break; case 2: id3.Add(nresult.Rows[i]); break; case 3: id4.Add(nresult.Rows[i]); break; case 4: id5.Add(nresult.Rows[i]); break; } } if (id1.Count > 0) { var task1 = new Task(() => { GoRequest(id1); }); task1.Start(); } if (id2.Count > 0) { var task2 = new Task(() => { GoRequest(id2); }); task2.Start(); } if (id3.Count > 0) { var task3 = new Task(() => { GoRequest(id3); }); task3.Start(); } if (id4.Count > 0) { var task4 = new Task(() => { GoRequest(id4); }); task4.Start(); } if (id5.Count > 0) { var task5 = new Task(() => { GoRequest(id5); }); task5.Start(); }