vb.net - वेबपेज IE, क्रोम और फ़ायरफ़ॉक्स में काम करता है, लेकिन.NET WebBrowser नियंत्रण का उपयोग करते समय नहीं




visual-studio-2010 visual-studio-2012 (2)

मैं Visual Studio 2010 में WebBrowser नियंत्रण का उपयोग कर रहा हूं और पृष्ठ प्रदर्शित करने का प्रयास कर रहा हूं: http://lk21.org

उस वेबपेज के अंदर बहुत सारी स्क्रिप्ट भरी हुई हैं, और यह ठीक काम करता है अगर मैं इसे वेब ब्राउज़र जैसे फ़ायरफ़ॉक्स, क्रोम और आईई के नवीनतम संस्करण के माध्यम से खोलता हूं।

मेरा प्रश्न यह है कि जब मैं उस पृष्ठ पर नेविगेट करने के लिए WebBrowser घटक का उपयोग करने का प्रयास करता हूं तो यह "खराब अनुरोध" क्यों प्रदर्शित करता है?

इसकी जांच करें:

अद्यतन करें:

दृश्य विन्सेंट के उत्तर का उपयोग करते हुए पृष्ठ अच्छी तरह से लोड होता है।

हालांकि वेबसाइट पर फ्लैश वीडियो (या मुझे लगता है कि यह फ्लैश के समान है) खेला नहीं जा सकता। नीचे दी गई छवियों में तुलना देखें।

अजीब बात है, अगर मैं YouTube खोलता हूं तो फ्लैश अच्छी तरह से काम करता है। थोड़ा शोध के बाद, यह कुछ और के कारण होने लगता है। कोई सुराग कैसे इसे हल करने के लिए?

इंटरनेट एक्सप्लोरर - ठीक काम करता है:

WebBrowser नियंत्रण - किसी कारण से वीडियो अटक गया है और इसे चलाया नहीं जा सकता है:


@ विज़ुअल विंसेंट उत्तर के आधार पर, यहां मैंने एक हल किया था:

1 - IEBrowserEmulationMode गणना:

''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Specifies a Internet Explorer browser emulation mode.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
''' <remarks>
''' <see href="https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/general-info/ee330730(v=vs.85)"/>
''' </remarks>
''' ----------------------------------------------------------------------------------------------------
Public Enum IEBrowserEmulationMode As Integer

    ''' <summary>
    ''' Webpages containing standards-based !DOCTYPE directives are displayed in IE7 Standards mode.
    ''' </summary>
    IE7 = 7000

    ''' <summary>
    ''' Webpages containing standards-based !DOCTYPE directives are displayed in IE8 mode. 
    ''' </summary>
    IE8 = 8000

    ''' <summary>
    ''' Webpages are displayed in IE8 Standards mode, regardless of the declared !DOCTYPE directive. 
    ''' <para></para>
    ''' Failing to declare a !DOCTYPE directive causes the page to load in Quirks.
    ''' </summary>
    IE8Standards = 8888

    ''' <summary>
    ''' Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode.
    ''' </summary>
    IE9 = 9000

    ''' <summary>
    ''' Webpages are displayed in IE9 Standards mode, regardless of the declared !DOCTYPE directive. 
    ''' <para></para>
    ''' Failing to declare a !DOCTYPE directive causes the page to load in Quirks.
    ''' </summary>
    IE9Standards = 9999

    ''' <summary>
    ''' Webpages containing standards-based !DOCTYPE directives are displayed in IE10 Standards mode.
    ''' </summary>
    IE10 = 10000

    ''' <summary>
    ''' Webpages are displayed in IE10 Standards mode, regardless of the !DOCTYPE directive.
    ''' </summary>
    IE10Standards = 10001

    ''' <summary>
    ''' Webpages containing standards-based !DOCTYPE directives are displayed in IE11 edge mode.
    ''' </summary>
    IE11 = 11000

    ''' <summary>
    ''' Webpages are displayed in IE11 edge mode, regardless of the declared !DOCTYPE directive. 
    ''' <para></para>
    ''' Failing to declare a !DOCTYPE directive causes the page to load in Quirks.
    ''' </summary>
    IE11Edge = 11001

End Enum

2 - रजिस्ट्रीस्कॉप एन्यूमरेशन।

''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Specifies a registry scope (a root key).
''' </summary>
''' ----------------------------------------------------------------------------------------------------
Public Enum RegistryScope As Integer

    ''' <summary>
    ''' This refers to the HKEY_LOCAL_MACHINE (or HKLM) registry root key.
    ''' <para></para>
    ''' Configuration changes made on the subkeys of this root key will affect all users.
    ''' </summary>
    Machine = 0

    ''' <summary>
    ''' This refers to the HKEY_CURRENT_USER (or HKCU) registry root key.
    ''' <para></para>
    ''' Configuration changes made on the subkeys of this root key will affect only the current user.
    ''' </summary>
    CurrentUser = 1

End Enum

3 - वर्तमान अनुप्रयोग के लिए IE ब्राउज़र इम्यूलेशन मोड प्राप्त करने या सेट करने के लिए BrowserEmulationMode गुण।

''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Gets or sets the Internet Explorer browser emulation mode for the current application.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
''' <seealso href="https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/general-info/ee330730(v=vs.85)"/>
''' ----------------------------------------------------------------------------------------------------
''' <example> This is a code example to get, set and verify the IE browser emulation mode for the current process.
''' <code>
''' Dim scope As RegistryScope = RegistryScope.CurrentUser
''' Dim oldMode As IEBrowserEmulationMode
''' Dim newMode As IEBrowserEmulationMode
''' 
''' oldMode = BrowserEmulationMode(scope)
''' BrowserEmulationMode(scope) = IEBrowserEmulationMode.IE11Edge
''' newMode = BrowserEmulationMode(scope)
''' 
''' Console.WriteLine(String.Format("Old Mode: {0} ({1})", oldMode, CStr(oldMode)))
''' Console.WriteLine(String.Format("New Mode: {0} ({1})", newMode, CStr(newMode)))
''' 
''' Dim f As New Form() With {.Size = New Size(1280, 720)}
''' Dim wb As New WebBrowser With {.Dock = DockStyle.Fill}
''' f.Controls.Add(wb)
''' f.Show()
''' wb.Navigate("http://www.whatversion.net/browser/")
''' </code>
''' </example>
''' ----------------------------------------------------------------------------------------------------
''' <param name="scope">
''' The registry scope.
''' </param>
''' ----------------------------------------------------------------------------------------------------
''' <value>
''' The Internet Explorer browser emulation mode.
''' </value>
''' ----------------------------------------------------------------------------------------------------
Public Shared Property BrowserEmulationMode(ByVal scope As RegistryScope) As IEBrowserEmulationMode
    <DebuggerStepThrough>
    Get
        Return GetIEBrowserEmulationMode(Process.GetCurrentProcess().ProcessName, scope)
    End Get
    <DebuggerStepThrough>
    Set(value As IEBrowserEmulationMode)
        SetIEBrowserEmulationMode(Process.GetCurrentProcess().ProcessName, scope, value)
    End Set
End Property

3 - GetieBrowserEmulationMode फ़ंक्शन और SetIEBrowserEmulationMode विधि, बाहरी अनुप्रयोग के लिए IE ब्राउज़र इम्यूलेशन मोड प्राप्त करने या सेट करने के लिए।

''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Gets the Internet Explorer browser emulation mode for the specified process.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
''' <seealso href="https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/general-info/ee330730(v=vs.85)"/>
''' ----------------------------------------------------------------------------------------------------
''' <example> This is a code example.
''' <code>
''' Dim processName As String = Process.GetCurrentProcess().ProcessName
''' Dim scope As RegistryScope = RegistryScope.CurrentUser
''' Dim mode As IEBrowserEmulationMode = GetIEBrowserEmulationMode(processName, scope)
''' 
''' Console.WriteLine(String.Format("Mode: {0} ({1})", mode, CStr(mode)))
''' </code>
''' </example>
''' ----------------------------------------------------------------------------------------------------
''' <param name="processName">
''' The process name (eg. 'cmd.exe').
''' </param>
''' 
''' <param name="scope">
''' The registry scope.
''' </param>
''' ----------------------------------------------------------------------------------------------------
''' <returns>
''' The resulting <see cref="IEBrowserEmulationMode"/>.
''' </returns>
''' ----------------------------------------------------------------------------------------------------
''' <exception cref="NotSupportedException">
''' </exception>
''' ----------------------------------------------------------------------------------------------------
<DebuggerStepThrough>
Public Shared Function GetIEBrowserEmulationMode(ByVal processName As String, ByVal scope As RegistryScope) As IEBrowserEmulationMode

    processName = Path.GetFileNameWithoutExtension(processName)

    Using rootKey As RegistryKey = If(scope = RegistryScope.CurrentUser,
                                      RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Default),
                                      RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default)),
          subKey As RegistryKey = rootKey.CreateSubKey("Software\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION",
                                                       RegistryKeyPermissionCheck.ReadSubTree)

        Dim value As Integer =
            CInt(subKey.GetValue(String.Format("{0}.exe", processName), 0, RegistryValueOptions.None))

        ' If no browser emulation mode is retrieved from registry, then return default version for WebBrowser control.
        If (value = 0) Then
            Return IEBrowserEmulationMode.IE7
        End If

        If [Enum].IsDefined(GetType(IEBrowserEmulationMode), value) Then
            Return DirectCast(value, IEBrowserEmulationMode)

        Else
            Throw New NotSupportedException(String.Format("Undefined browser emulation value retrieved from registry: '{0}'", value))


        End If

    End Using

End Function

''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Gets the Internet Explorer browser emulation mode for the specified process.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
''' <seealso href="https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/general-info/ee330730(v=vs.85)"/>
''' ----------------------------------------------------------------------------------------------------
''' <example> This is a code example.
''' <code>
''' Dim p As Process = Process.GetCurrentProcess()
''' Dim scope As RegistryScope = RegistryScope.CurrentUser
''' Dim mode As IEBrowserEmulationMode = GetIEBrowserEmulationMode(p, scope)
''' 
''' Console.WriteLine(String.Format("Mode: {0} ({1})", mode, CStr(mode)))
''' </code>
''' </example>
''' ----------------------------------------------------------------------------------------------------
''' <param name="p">
''' The process.
''' </param>
''' 
''' <param name="scope">
''' The registry scope.
''' </param>
''' ----------------------------------------------------------------------------------------------------
''' <returns>
''' The resulting <see cref="IEBrowserEmulationMode"/>.
''' </returns>
''' ----------------------------------------------------------------------------------------------------
''' <exception cref="NotSupportedException">
''' </exception>
''' ----------------------------------------------------------------------------------------------------
<DebuggerStepThrough>
Public Shared Function GetIEBrowserEmulationMode(ByVal p As Process, ByVal scope As RegistryScope) As IEBrowserEmulationMode

    Return GetIEBrowserEmulationMode(p.ProcessName, scope)

End Function

''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Sets the Internet Explorer browser emulation mode for the specified process.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
''' <seealso href="https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/general-info/ee330730(v=vs.85)"/>
''' ----------------------------------------------------------------------------------------------------
''' <example> This is a code example.
''' <code>
''' Dim processName As String = Process.GetCurrentProcess().ProcessName
''' Dim scope As RegistryScope = RegistryScope.CurrentUser
''' Dim oldMode As IEBrowserEmulationMode
''' Dim newMode As IEBrowserEmulationMode
''' 
''' oldMode = GetIEBrowserEmulationMode(processName, scope)
''' SetIEBrowserEmulationMode(processName, scope, IEBrowserEmulationMode.IE11Edge)
''' newMode = GetIEBrowserEmulationMode(processName, scope)
''' 
''' Console.WriteLine(String.Format("Old Mode: {0} ({1})", oldMode, CStr(oldMode)))
''' Console.WriteLine(String.Format("New Mode: {0} ({1})", newMode, CStr(newMode)))
''' 
''' Dim f As New Form() With {.Size = New Size(1280, 720)}
''' Dim wb As New WebBrowser With {.Dock = DockStyle.Fill}
''' f.Controls.Add(wb)
''' f.Show()
''' wb.Navigate("http://www.whatversion.net/browser/")
''' </code>
''' </example>
''' ----------------------------------------------------------------------------------------------------
''' <param name="processName">
''' The process name (eg. 'cmd.exe').
''' </param>
''' 
''' <param name="scope">
''' The registry scope.
''' </param>
''' 
''' <param name="mode">
''' The Internet Explorer browser emulation mode to set.
''' </param>
''' ----------------------------------------------------------------------------------------------------
''' <exception cref="NotSupportedException">
''' </exception>
''' ----------------------------------------------------------------------------------------------------
<DebuggerStepThrough>
Public Shared Sub SetIEBrowserEmulationMode(ByVal processName As String, ByVal scope As RegistryScope, ByVal mode As IEBrowserEmulationMode)

    processName = Path.GetFileNameWithoutExtension(processName)

    Dim currentIEBrowserEmulationMode As IEBrowserEmulationMode = GetIEBrowserEmulationMode(processName, scope)
    If (currentIEBrowserEmulationMode = mode) Then
        Exit Sub
    End If

    Using rootKey As RegistryKey = If(scope = RegistryScope.CurrentUser,
                                      RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Default),
                                      RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default)),
          subKey As RegistryKey = rootKey.CreateSubKey(
                    "Software\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION",
                    RegistryKeyPermissionCheck.ReadWriteSubTree)

        subKey.SetValue(String.Format("{0}.exe", processName),
                        DirectCast(mode, Integer), RegistryValueKind.DWord)

    End Using

End Sub

''' ----------------------------------------------------------------------------------------------------
''' <summary>
''' Sets the Internet Explorer browser emulation mode for the specified process.
''' </summary>
''' ----------------------------------------------------------------------------------------------------
''' <seealso href="https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/general-info/ee330730(v=vs.85)"/>
''' ----------------------------------------------------------------------------------------------------
''' <example> This is a code example.
''' <code>
''' Dim processName As Process = Process.GetCurrentProcess()
''' Dim scope As RegistryScope = RegistryScope.CurrentUser
''' Dim oldMode As IEBrowserEmulationMode
''' Dim newMode As IEBrowserEmulationMode
''' 
''' oldMode = GetIEBrowserEmulationMode(p, scope)
''' SetIEBrowserEmulationMode(p, scope, IEBrowserEmulationMode.IE11Edge)
''' newMode = GetIEBrowserEmulationMode(p, scope)
''' 
''' Console.WriteLine(String.Format("Old Mode: {0} ({1})", oldMode, CStr(oldMode)))
''' Console.WriteLine(String.Format("New Mode: {0} ({1})", newMode, CStr(newMode)))
''' 
''' Dim f As New Form() With {.Size = New Size(1280, 720)}
''' Dim wb As New WebBrowser With {.Dock = DockStyle.Fill}
''' f.Controls.Add(wb)
''' f.Show()
''' wb.Navigate("http://www.whatversion.net/browser/")
''' </code>
''' </example>
''' ----------------------------------------------------------------------------------------------------
''' <param name="p">
''' The process.
''' </param>
''' 
''' <param name="scope">
''' The registry scope.
''' </param>
''' 
''' <param name="mode">
''' The Internet Explorer browser emulation mode to set.
''' </param>
''' ----------------------------------------------------------------------------------------------------
''' <exception cref="NotSupportedException">
''' </exception>
''' ----------------------------------------------------------------------------------------------------
<DebuggerStepThrough>
Public Shared Sub SetIEBrowserEmulationMode(ByVal p As Process, ByVal scope As RegistryScope, ByVal mode As IEBrowserEmulationMode)

    SetIEBrowserEmulationMode(p.ProcessName, scope, mode)

End Sub

वर्तमान प्रक्रिया के लिए IE ब्राउज़र इम्यूलेशन मोड को प्राप्त करने, सेट करने और सत्यापित करने के लिए उपयोग उदाहरण:

Dim scope As RegistryScope = RegistryScope.CurrentUser
Dim oldMode As IEBrowserEmulationMode
Dim newMode As IEBrowserEmulationMode

oldMode = BrowserEmulationMode(scope)
BrowserEmulationMode(scope) = IEBrowserEmulationMode.IE11Edge
newMode = BrowserEmulationMode(scope)

Console.WriteLine(String.Format("Old Mode: {0} ({1})", oldMode, CStr(oldMode)))
Console.WriteLine(String.Format("New Mode: {0} ({1})", newMode, CStr(newMode)))

Dim f As New Form() With {.Size = New Size(1280, 720)}
Dim wb As New WebBrowser With {.Dock = DockStyle.Fill}
f.Controls.Add(wb)
f.Show()
wb.Navigate("http://www.whatversion.net/browser/")

एक विशिष्ट प्रक्रिया के लिए IE ब्राउज़र इम्यूलेशन मोड को प्राप्त करने, सेट करने और सत्यापित करने के लिए उपयोग उदाहरण:

Dim processName As String = Process.GetCurrentProcess().ProcessName
Dim scope As RegistryScope = RegistryScope.CurrentUser
Dim oldMode As IEBrowserEmulationMode
Dim newMode As IEBrowserEmulationMode

oldMode = GetIEBrowserEmulationMode(processName, scope)
SetIEBrowserEmulationMode(processName, scope, IEBrowserEmulationMode.IE11Edge)
newMode = GetIEBrowserEmulationMode(processName, scope)

Console.WriteLine(String.Format("Old Mode: {0} ({1})", oldMode, CStr(oldMode)))
Console.WriteLine(String.Format("New Mode: {0} ({1})", newMode, CStr(newMode)))

Dim f As New Form() With {.Size = New Size(1280, 720)}
Dim wb As New WebBrowser With {.Dock = DockStyle.Fill}
f.Controls.Add(wb)
f.Show()
wb.Navigate("http://www.whatversion.net/browser/")

यह संभवतः ऐसा करने के लिए मिला है कि डिफ़ॉल्ट रूप से WebBrowser नियंत्रण IE 7 के दस्तावेज़ इम्यूलेशन मोड का उपयोग करता है, जिसका अर्थ है कि सभी पेज इंटरनेट एक्सप्लोरर 7 इंजन का उपयोग करके नियंत्रित किए जाते हैं। चूँकि वह संस्करण काफी पुराना है, अधिकांश वेबसाइटें आज इसके अनुकूल नहीं हैं, जो पृष्ठ पर जाने पर कार्यक्षमता को प्रभावित करती हैं।

आप रजिस्ट्री कुंजी Software\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION में या तो HKEY_LOCAL_MACHINE हाइव या HKEY_CURRENT_USER में अपने अनुप्रयोग के लिए एक मान जोड़कर इस व्यवहार को बदल सकते हैं। ऐसा करके आप अपने अनुप्रयोग को IE इंजन के एक विशिष्ट संस्करण का उपयोग करने के लिए मजबूर कर रहे हैं।

मैंने एक वर्ग लिखा है, जो आपको इसमें मदद करेगा:

'A class for changing the WebBrowser control's document emulation.
'Written by Visual Vincent, 2017.

Imports Microsoft.Win32
Imports System.Security
Imports System.Windows.Forms

Public NotInheritable Class InternetExplorer
    Private Sub New()
    End Sub

    Public Const InternetExplorerRootKey As String = "Software\Microsoft\Internet Explorer"
    Public Const BrowserEmulationKey As String = InternetExplorerRootKey & "\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION"
    Public Const ActiveXObjectCachingKey As String = InternetExplorerRootKey & "\MAIN\FeatureControl\FEATURE_OBJECT_CACHING"

    Private Shared ReadOnly WebBrowserInstance As New WebBrowser 'Used to get the current IE version in a .NET-friendly manner.

    Public Enum BrowserEmulation As Integer
        IE7 = 7000
        IE8 = 8000
        IE8Standards = 8888
        IE9 = 9000
        IE9Standards = 9999
        IE10 = 10000
        IE10Standards = 10001
        IE11 = 11000
        IE11Edge = 11001
    End Enum

    Public Shared Sub SetLatestBrowserEmulation(ByVal Root As RegistryRoot)
        Dim Emulation As BrowserEmulation = BrowserEmulation.IE7
        Select Case WebBrowserInstance.Version.Major
            Case Is >= 11 : Emulation = BrowserEmulation.IE11Edge
            Case 10 : Emulation = BrowserEmulation.IE10Standards
            Case 9 : Emulation = BrowserEmulation.IE9Standards
            Case 8 : Emulation = BrowserEmulation.IE8Standards
        End Select
        InternetExplorer.SetBrowserEmulation(Root, Emulation)
    End Sub

    Public Shared Sub SetBrowserEmulation(ByVal Root As RegistryRoot, ByVal Emulation As BrowserEmulation)
        Using RootKey As RegistryKey = Root.Root
            Dim EmulationKey As RegistryKey = RootKey.OpenSubKey(BrowserEmulationKey, True)
            If EmulationKey Is Nothing Then EmulationKey = RootKey.CreateSubKey(BrowserEmulationKey, RegistryKeyPermissionCheck.ReadWriteSubTree)

            Using EmulationKey
                EmulationKey.SetValue(Process.GetCurrentProcess().ProcessName & ".exe", CType(Emulation, Integer), RegistryValueKind.DWord)
            End Using
        End Using
    End Sub

    Public Shared Sub SetActiveXObjectCaching(ByVal Root As RegistryRoot, ByVal Enabled As Boolean)
        Using RootKey As RegistryKey = Root.Root
            Dim ObjectCachingKey As RegistryKey = RootKey.OpenSubKey(ActiveXObjectCachingKey, True)
            If ObjectCachingKey Is Nothing Then ObjectCachingKey = RootKey.CreateSubKey(ActiveXObjectCachingKey, RegistryKeyPermissionCheck.ReadWriteSubTree)

            Using ObjectCachingKey
                ObjectCachingKey.SetValue(Process.GetCurrentProcess().ProcessName & ".exe", CType(If(Enabled, 1, 0), Integer), RegistryValueKind.DWord)
            End Using
        End Using
    End Sub

    Public NotInheritable Class RegistryRoot
        Private _root As RegistryKey

        Public ReadOnly Property Root As RegistryKey
            Get
                Return _root
            End Get
        End Property

        Public Shared ReadOnly Property HKEY_LOCAL_MACHINE As RegistryRoot
            Get
                Return New RegistryRoot(Registry.LocalMachine)
            End Get
        End Property

        Public Shared ReadOnly Property HKEY_CURRENT_USER As RegistryRoot
            Get
                Return New RegistryRoot(Registry.CurrentUser)
            End Get
        End Property

        Private Sub New(ByVal Root As RegistryKey)
            Me._root = Root
        End Sub
    End Class
End Class

इसका उपयोग करने के लिए, एप्लिकेशन के Startup ईवेंट में इनमें से एक लाइन डालें:

InternetExplorer.SetLatestBrowserEmulation(InternetExplorer.RegistryRoot.HKEY_LOCAL_MACHINE)

'HKEY_CURRENT_USER is recommended if you do not want to run your application with administrative privileges.
InternetExplorer.SetLatestBrowserEmulation(InternetExplorer.RegistryRoot.HKEY_CURRENT_USER)

( नोट: HKEY_LOCAL_MACHINE रूट का उपयोग करने के लिए प्रशासनिक विशेषाधिकारों की आवश्यकता होती है)

InternetExplorer.SetLatestBrowserEmulation() विधि Internet Explorer के नवीनतम INSTALLED संस्करण के लिए, निर्दिष्ट रजिस्ट्री रूट में, आपके एप्लिकेशन के लिए ब्राउज़र एमुलेशन सेट करेगी।

हालाँकि, InternetExplorer.SetBrowserEmulation() विधि का उपयोग करके आप मैन्युअल रूप से नियंत्रित कर सकते हैं कि IE संस्करण को क्या करना चाहिए (अनुशंसित नहीं है!)

और पढो:

संपादित करें

मुझे ऐसा लगता है कि मैं उस साइट में प्रवेश नहीं कर पा रहा हूं, लेकिन मैंने जो पढ़ा है उससे वेबब्राउजर नियंत्रण में फ्लैश होस्ट की समस्याएं पैदा हो गई हैं

आप जो प्रयास कर सकते हैं वह ActiveX ऑब्जेक्ट कैशिंग सुविधा को अक्षम करना है, जो स्पष्ट रूप से फ्लैश नियंत्रण के लिए कुछ मुद्दों का कारण बन सकता है।

मैंने उपरोक्त InternetExplorer वर्ग को अपडेट किया। इसे कॉपी-पेस्ट करें, फिर इस लाइन को अपने एप्लिकेशन के स्टार्टअप ईवेंट में जोड़ें:

InternetExplorer.SetActiveXObjectCaching(InternetExplorer.RegistryRoot.HKEY_CURRENT_USER, False)

अगर यह अभी भी काम नहीं करता है तो मुझे डर है कि आप भाग्य से बाहर हैं मुझे कुछ और नहीं मिला जो उपयोगी हो।





webbrowser-control