private void button1_Click(object sender, RoutedEventArgs e) { Links links = new Links(); HttpWorker httpWork = new HttpWorker(); List <Thread> threads = new List <Thread>(); int page = httpWork.WebReqPages(links.Link(button1.Content.ToString())); if (page > 0) { ThreadParam tp = new ThreadParam(); if (radioButton.IsChecked == true) { tp.GridFile = true; } else { tp.GridFile = false; } for (int i = 1; i <= page; i++) { tp.Name = links.Link(button1.Content.ToString()); tp.Page = i.ToString(); tp.MaxPage = page.ToString(); tp.NameExcange = button1.Content.ToString(); new System.Threading.Thread(() => { httpWork.WebReq(tp.Name, tp.Page, tp.MaxPage, tp.GridFile, tp.NameExcange); }); } } }
private void fornewthread(object tp)//string btn, string i { ThreadParam c = (ThreadParam)tp; HttpWorker httpWork = new HttpWorker(); // foreach (ListRows lstRow in httpWork.WebReq(c.Name, c.Page, c.MaxPage, c.GridFile, c.NameExcange);//) /* { * lstRows.Add(lstRow); * }*/ }