使用线程来打开文件
1、首先要添加命名空间:using System.Diagnostics;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
namespace _1.线程进程
{
class Program
{
static void Main(string[] args)
{
//使用进程来打开文件
//Proess进程需要一个ProcessStartInfo文件,所以第一步创建一个psi文件
ProcessStartInfo psi = new ProcessStartInfo(@"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", @"-kiosk http://www.baidu.com");
//创建一个进程执行对象
Process p = new Process();
//把刚刚建的PSI赋值给ProcessStartInfo;
p.StartInfo = psi;
//启动进程
p.Start();
}
}
}