[C#] 纯文本查看 复制代码 private void button5_Click(object sender, EventArgs e)
{
testResult.Clear();
foreach (var item in proxys)
{
ThreadPool.QueueUserWorkItem(new WaitCallback(TestProcy_s), item);
}
}
private List<string> testResult=new List<string>();
private void TestProcy_s(object obj)
{
try
{
bool result = TestProxy((string)obj);
if (result)
{
testResult.Add( (string)obj + " 可用\r");
}
else
{
testResult.Add( (string)obj + " 不可用\r");
}
this.textBox2.Lines = testResult.ToArray();
}
catch (Exception)
{
throw;
}
} |