C#进程启动实例

1.调用widnows资源管理器打开文件夹

        private void OpenFolder(string folder)

        {

            System.Diagnostics.Process.Start("explorer.exe", folder);

        }

 

 2.调用IE浏览器打开指定的网址

        private void button1_Click(object sender, EventArgs e)

        {

            //方法1

            System.Diagnostics.Process.Start("iexplore.exe", "http://www.bing.com");





            //方法2

            System.Diagnostics.Process[] newProcess = new System.Diagnostics.Process[1];

            newProcess[0] = new System.Diagnostics.Process();

            newProcess[0].StartInfo.FileName = "iexplore.exe";

            newProcess[0].StartInfo.Arguments = "http://www.bing.com";

            newProcess[0].Start();

        }

 

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