C# how to do multithreading in the checker?

For their development, make the checker proxy
Suppose I have a file proxy.txt in which the proxy with each new line
I need what would the program take each line and send say the server get request with this proxy "domain.com/api?proxy={modproxy}" . And the answer is simply recorded in another txt. And here problem how to make soft mnogopotochnoy. So I can enter the number of threads. For thus very slowly checks. If something is not well written (did) do not beat with a stick, just signed up.
March 20th 20 at 11:42
1 answer
March 20th 20 at 11:44
Streams can't be played, it is better to use Task.

Asynchronous programming in task-based
Parallel.ForEach Method
When to use Parallel.ForEach and PLINQ when

Imagine that proxy.txt this is the list of tasks when reading a file you create and transmit to the ThreadPool, it will distribute them between CPU cores and allocate the desired number of threads. Your task will be reduced only to the "bonding" of the results. Record the result immediately after the task ended, but you can just keep oprative, and write only at the end.

Look for another thread-safe collection

Find more questions by tags C#Proxy