【发布时间】:2015-01-20 01:45:32
【问题描述】:
我需要在隐藏模式下运行 IE11(不显示浏览器),这样我就可以设置一个 cookie。这是我之前在 IE9 中使用的代码
cmd = (String)Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Classes\IE.AssocFile.HTM\shell\opennew\command", "", null);
url = "http://www.stackoverflow.com";
Process process = Process.Start(new ProcessStartInfo()
{
FileName = cmd,
Arguments = url,
WindowStyle = ProcessWindowStyle.Hidden
});
如果我在带有 IE11 的机器上使用它,它会显示浏览器。有没有办法可以做到这一点?
【问题讨论】:
标签: c# internet-explorer internet-explorer-11