private void checkProxies()
{
foreach(string x in proxyList)
{
Task<bool> task = CheckProxy.CheckProxyNonBlocking(x);
Application.DoEvents();
task.ContinueWith((t) =>
{
if (!t.Result)
Application.DoEvents();
else
{
this.Invoke((MethodInvoker)delegate
{
validTextBox.Text += x + "\n";
});
}
});
}
}
I'm trying to build a proxy checker with a multi-threaded design ,proxyList is a variable from the type of 'string[]'.
My question is , if the checking takes a lot of time, is the x I am passing to the function checkProxyNonBlocking is the same x I'm dealing with in continue with?