C# 为什么即使IE没有';你不辞职吗?

C# 为什么即使IE没有';你不辞职吗?,c#,internet-explorer,events,browser,automation,C#,Internet Explorer,Events,Browser,Automation,有以下代码: Dim InternetExplorer As New SHDocVw.InternetExplorer InternetExplorer.Visible = True InternetExplorer. Navigate("http://stackoverflow.com/") AddHandler InternetExplorer.OnQuit, Sub() Console.WriteLine("InternetExplorer.OnQuit

有以下代码:

Dim InternetExplorer As New SHDocVw.InternetExplorer
InternetExplorer.Visible = True

InternetExplorer.
    Navigate("http://stackoverflow.com/")

AddHandler InternetExplorer.OnQuit,
    Sub()
        Console.WriteLine("InternetExplorer.OnQuit")
    End Sub
当我在InternetExplorer11下运行代码时

  • Internet Explorer打开
  • Internet Explorer导航到
    http://stackoverflow.com/
    第页
  • 如果然后我单击
    问题
    按钮

  • OnQuit
    事件激发和控制台写入
    InternetExplorer.OnQuit
  • 但是有问题的页面
    http://stackoverflow.com/questions
    成功加载
  • 如果然后我返回并再次单击
    Questions
    按钮
    OnQuit
    事件不会触发,但Internet Explorer会丢失所有事件订阅

  • 即使IE没有退出,IE怎么可能在导航时触发
    OnQuit
    事件
  • 为什么IE在页面更改时会丢失所有事件订阅

  • 你有没有想过?我也看到了同样的问题。我们的解决方法是大量的黑客尝试跟踪哪些InternetExplorer实例对应于活动标签,哪些不对应。