您的位置:首页 > 编程语言 > C#

c# 同时打开三个不同的网页

2012-03-31 10:54 176 查看
引用:http://zhidao.baidu.com/question/111142848.html

用默认浏览器打开: System.Diagnostics.Process.Start("http://www.hao123.com");

使用ie:

using System.Diagnostics;

Process.Start(@"C:\Program Files\Internet Explorer\iexplore.exe", "http://www.baidu.com/");

----------------------------------------------------------------------------------------------------

int index = -1;
string[] urls = new string[] { "www.baidu.com", "www.126.com", "www.xunlei.com" };
private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < 3; i++)
{
Thread th = new Thread(new ThreadStart(Run));
th.Start();
}
}
void Run()
{
index++;
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "iexplore";
p.StartInfo.Arguments = urls[index];
p.Start();
p.Close();
p.Dispose();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: