Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# System.Windows.Forms.WebBrowser脚本访问问题_C#_Winforms_Internet Explorer_Browser - Fatal编程技术网

C# System.Windows.Forms.WebBrowser脚本访问问题

C# System.Windows.Forms.WebBrowser脚本访问问题,c#,winforms,internet-explorer,browser,C#,Winforms,Internet Explorer,Browser,我目前在使用System.Windows.Forms.WebBrowser构建的一些门户网站上遇到问题。它们没有像IE中那样正确加载内容 我已经将仿真设置为使用功能\浏览器\仿真来使用IE11,我不明白为什么它不像已安装的IE11 它显示“浏览器中的脚本访问被拒绝”或根本不加载内容,表示我需要升级浏览器。可能您的代码有问题。检查 值11001-强制网页以IE11边缘模式显示,而不考虑!DOCTYPE指令。您需要在目标系统上安装IE11 private static void WebBrowser

我目前在使用System.Windows.Forms.WebBrowser构建的一些门户网站上遇到问题。它们没有像IE中那样正确加载内容

我已经将仿真设置为使用功能\浏览器\仿真来使用IE11,我不明白为什么它不像已安装的IE11


它显示“浏览器中的脚本访问被拒绝”或根本不加载内容,表示我需要升级浏览器。

可能您的代码有问题。检查

值11001-强制网页以IE11边缘模式显示,而不考虑!DOCTYPE指令。您需要在目标系统上安装IE11

private static void WebBrowserVersionEmulation()
{
    const string BROWSER_EMULATION_KEY = 
    @"Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION";
    //
    // app.exe and app.vshost.exe
    String appname = Process.GetCurrentProcess().ProcessName + ".exe";
    //
    // Internet Explorer 11. Webpages are displayed in IE11 edge mode, regardless of the !DOCTYPE directive.
    const int browserEmulationMode = 11001;

    RegistryKey browserEmulationKey =
        Registry.CurrentUser.OpenSubKey(BROWSER_EMULATION_KEY,RegistryKeyPermissionCheck.ReadWriteSubTree) ??
        Registry.CurrentUser.CreateSubKey(BROWSER_EMULATION_KEY);

    if (browserEmulationKey != null)
    {
        browserEmulationKey.SetValue(appname, browserEmulationMode, RegistryValueKind.DWord);
        browserEmulationKey.Close();
    }
}
仍然会出现“脚本”访问错误。也许这是Flash的问题?