Answer the question
In order to leave comments, you need to log in
How to download several web pages at the same time in c#?
There is a site site.com It has many pages like site.com/id1 ... site.com/id100000. I need to download these pages. But one page at a time (even at a speed of 100Mb) they will take a long time to download. How to implement a program so that it loads at once, for example, 10 pages each?
Answer the question
In order to leave comments, you need to log in
Quick way:
var urls = new List<string>()
{
"http://google.com",
"http://yandex.com"
}
Parallel.ForEach(urls, (url) =>
{
// код получения и обработки.
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question