【发布时间】:2012-09-24 07:46:21
【问题描述】:
我想打开 IE(打开的网站无关紧要),但我发现使用以下代码:
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = "http://www.google.com";
proc.Start();
将以当前用户身份启动浏览器,但使用以下代码:
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "C:\\Program Files\\Internet Explorer\\iexplore.exe";
Process process = new Process();
process.StartInfo = startInfo;
process.Start();
不会,这是为什么呢?是什么原因?
【问题讨论】:
-
第二个代码会发生什么?那这种情况下IE是用什么用户打开的呢?
标签: c# internet-explorer