飞哥,我这样子的话 ,你觉得有错吗?
我试了下,调试输出窗口中一直显示“xxx线程退出”,加了td.Join()也是一样的
代码如下:
[C#] 纯文本查看 复制代码
public List<string> iplist = new List<string>();
private void button1_Click(object sender, EventArgs e)
{
iplist.Add("183.207.228.123:80");
iplist.Add("211.138.121.38:80");
iplist.Add("122.224.223.140:80");
iplist.Add("5.39.68.172:3128");
iplist.Add("171.8.66.210:3128");
iplist.Add("60.29.245.187:8080");
iplist.Add("218.18.28.45:9000");
iplist.Add("96.39.53.60:8080");
iplist.Add("222.218.152.36:9999");
iplist.Add("202.182.52.74:9876");
iplist.Add("61.175.96.34:9999");
iplist.Add("207.250.176.137:80");
iplist.Add("14.17.116.191:80");
iplist.Add("80.228.68.8:3128");
for (int i = 0; i < 10;i++ )
{
Thread td = new Thread(new ParameterizedThreadStart(test));
td.SetApartmentState(ApartmentState.STA);
td.Start(iplist[i]);
}
}
private void test(object obj)
{
//代理IP设置
BrowserProxy.RefreshIESettings(obj.ToString());
WebBrowser myBrowser = new WebBrowser();
myBrowser.ScriptErrorsSuppressed = true;
myBrowser.Navigate("http://www.sufeinet.com/");
}
|