Foxtable(狐表)用户栏目专家坐堂 → mht文件用WebBrowser控件能否打开,与什么有关?


  共有2190人关注过本帖树形打印复制链接

主题:mht文件用WebBrowser控件能否打开,与什么有关?

帅哥哟,离线,有人找我吗?
kgdce
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:620 积分:6782 威望:0 精华:0 注册:2013/12/17 1:00:00
mht文件用WebBrowser控件能否打开,与什么有关?  发帖心情 Post By:2021/9/8 20:11:00 [只看该作者]

经测试,发现mht文件用WebBrowser控件(在64位win10 谷歌浏览器 这样的环境下)可以打开,在32位win7 360浏览器环境下 打不开?请问WebBrowser控件打开mht格式文件和电脑安装的系统和浏览器有关系吗?

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106688 积分:542629 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/9/9 9:50:00 [只看该作者]

WebBrowser控件使用的是IE内核,和其它外部浏览器没有关系。电脑安装最新版的IE11

 回到顶部
帅哥哟,离线,有人找我吗?
kgdce
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:620 积分:6782 威望:0 精华:0 注册:2013/12/17 1:00:00
  发帖心情 Post By:2021/9/9 9:58:00 [只看该作者]

如何用代码检验是否为IE11

 回到顶部
帅哥,在线噢!
有点蓝
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106688 积分:542629 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/9/9 10:16:00 [只看该作者]

检测不了

 回到顶部
帅哥哟,离线,有人找我吗?
kgdce
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:620 积分:6782 威望:0 精华:0 注册:2013/12/17 1:00:00
  发帖心情 Post By:2021/9/9 11:05:00 [只看该作者]

Private Shared Sub SetWebBrowserFeatures(ByVal ieVersion As Integer)

    If LicenseManager.UsageMode <> LicenseUsageMode.Runtime Then Return

    ‘Get the program and name

    Dim appName = System.IO.Path.GetFileName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName)

    ‘Get the value of the browser‘s mode

    Dim ieMode As UInt32 = GeoEmulationModee(ieVersion)

    Dim featureC

    ‘Set the browser to run the app (appName) in what mode (ieMode)

    Registry.SetValue(featureControlRegKey & "FEATURE_BROWSER_EMULATION", appName, ieMode, RegistryValueKind.DWord)

    ‘enable the features which are "On" for the full Internet Explorer browser

    Registry.SetValue(featureControlRegKey & "FEATURE_ENABLE_CLIPCHILDREN_OPTIMIZATION", appName, 1, RegistryValueKind.DWord)

End Sub

 

get version

Private Shared Function GetBrowserVersion() As Integer

    Dim browserVersion As Integer = 0

 

    Using ieKey = Registry.LocalMachine.OpenSubKey("SOFTWAREMicrosoftInternet Explorer", RegistryKeyPermissionCheck.ReadSubTree, System.Security.AccessControl.RegistryRights.QueryValues)

        Dim version = ieKey.GetValue("svcVersion")

 

        If version Is Nothing Then

            version = ieKey.GetValue("Version")

            If version Is Nothing Then Throw New ApplicationException("Microsoft Internet Explorer is required!")

        End If

 

        Integer.TryParse(version.ToString().Split("."c)(0), browserVersion)

    End Using

 

    If browserVersion < 7 Then

        Throw New ApplicationException("Not Support!")

    End If

 

    Return browserVersion

End Function

 

Private Shared Function GeoEmulationModee(ByVal browserVersion As Integer) As UInt32

    Dim mode As UInt32 = 11000

 

    Select Case browserVersion

        Case 7

            mode = 7000

        Case 8

            mode = 8000

        Case 9

            mode = 9000

        Case 10

            mode = 10000

        Case 11

            mode = 11000

    End Select

 

    Return mode

End Function


 回到顶部