终止 Internet Explorer 会导致崩溃恢复提示
我目前正在开发一个使用嵌入式 Internet Explorer 浏览器的应用程序。 该应用程序是在Visual Studio 2010中用C#编写的。IE是IE9,但在以前版本的IE中也会出现该问题。
该应用程序基于 Oracle Customer On Demand,但它是一个使用嵌入式浏览器并向其添加一些扩展的独立应用程序。
现在的问题是,每当我关闭应用程序并打开 IE 时,IE 都会告诉我: - 您上次的浏览会话意外关闭。它想重新打开我的应用程序中使用的页面。
我怎样才能防止这种情况发生?我知道我可以关闭“启用自动崩溃恢复”,但我认为这不是一个干净的解决方案。有没有办法从 Visual Studio 中正确关闭 IE?
目前它通过执行以下操作关闭:
foreach ( var ieProcessId in this.ieProcessIds )
{
Process.GetProcessById(ieProcessId).Close();
Process.GetProcessById(ieProcessId).Kill();
}
I'm currently working on an application that uses an embedded internet explorer browser.
The application is written in C# in visual studio 2010. IE is IE9, but the problem also occurs in previous versions of IE.
The application is based on Oracle Customer On Demand, but is a standalone application that uses the embedded browser and adds some extensions to it.
Now the problem is, whenever I close my application, and open IE, IE tells me: -Your last browsing session closed unexpectedly. And it wants to reopen the page used in my application.
How can I prevent this? I know I can turn off "enable automatic crash recovery" but I don't think this is a clean solution. Is there a way to close IE from inside Visual studio properly?
At the moment it gets closed by doing:
foreach ( var ieProcessId in this.ieProcessIds )
{
Process.GetProcessById(ieProcessId).Close();
Process.GetProcessById(ieProcessId).Kill();
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Kill() 它立即停止(当应用程序无法保存自己的结果时)。
更温和地尝试 CloseMainWindow()。
Kill() it's immediate stop (when application can't save own resoults).
Try more gently CloseMainWindow().