WebBrowser control and Windows 10 issue (Navigation canceled)

本秂侑毒 提交于 2019-12-06 12:37:22

问题


I'm trying to run a WebBrowser containing form on a new STA thread.

The code runs as expected on Windows 7, but on Windows 10 the navigation cancels automatically.

I tried to set each of the zone security settings to minimum from Internet Options but nothing changed.

Navigation to the webpage was canceled

Zone: My Computer | Protected Mode: Off res://ieframe.dll/navcancl.htm#https://google.com/

This page can’t be displayed

Zone: My Computer | Protected Mode: Off res://ieframe.dll/dnserrordiagoff.htm#https://google.com/

Any suggestions?

private void button1_Click(object sender, EventArgs e)
{
    ServicePointManager.DefaultConnectionLimit = 10;

    var thread = new Thread(ShowFormWebBrowser) {IsBackground = true};
    thread.SetApartmentState(ApartmentState.STA);

    thread.Start();
}

public static void ShowFormWebBrowser()
{
    using (var dlg = new FormWebBrowser())
    {
        if (dlg.ShowDialog() == DialogResult.OK)
        {
        }
    }
}

来源:https://stackoverflow.com/questions/36632315/webbrowser-control-and-windows-10-issue-navigation-canceled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!