Пример #1
0
        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);
                    });
                }
            }
        }
Пример #2
0
        private List <ListRows> loadAll(string link)
        {
            lstRows = new List <ListRows>();
            HttpWorker httpWork = new HttpWorker();
            int        page     = httpWork.WebReqPages(link);

            for (int i = 1; i <= page; i++)
            {
                /* foreach (ListRows lstRow in httpWork.WebReq(link, page.ToString()))
                 * {
                 *   lstRows.Add(lstRow);
                 * }*/
            }

            return(lstRows);
        }