|
Process.Start 方法 (ProcessStartInfo)
启动由包含进程启动信息(例如,要启动的进程的文件名)的参数指定的进程资源,并将该资源与新的 Process 组件关联。
System.Diagnostics.Process.Start("Iexplore.exe","http://www.agoit.com");//打开网页
System.Diagnostics.Process.Start("cmd","/k echo 'ok'");//执行DOS命令
System.Diagnostics.Process.Start("explorer","C:\\windows\\system32");//打开本地文件夹
System.Diagnostics.Process.Start("shutdown","/l");//注销计算机
System.Diagnostics.Process.Start("shutdown","/r");//重启计算机
|
|