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

引用: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();
        }

你可能感兴趣的:(C#)