Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Change default browser

Add New Class

Code:
Code
Namespace My
    Partial Friend Class MyApplication
        Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
            CreateBrowserKey()
        End Sub
        Private Sub MyApplication_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown
            ' I don't like applications that defecate in the registry and then don't cleanup their own mess
            ' so remove the key
            RemoveBrowerKey()
        End Sub
        Private Const BrowserKeyPath As String = "\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION"
        Private Sub CreateBrowserKey(Optional ByVal IgnoreIDocDirective As Boolean = False)
            Dim basekey As String = Microsoft.Win32.Registry.CurrentUser.ToString
            Dim value As Int32
            Dim thisAppsName As String = My.Application.Info.AssemblyName & ".exe"
            Select Case (New WebBrowser).Version.Major
                Case 8
                    If IgnoreIDocDirective Then
                        value = 8888
                    Else
                        value = 8000
                    End If
                Case 9
                    If IgnoreIDocDirective Then
                        value = 9999
                    Else
                        value = 9000
                    End If
                Case 10
                    If IgnoreIDocDirective Then
                        value = 10001
                    Else
                        value = 10000
                    End If
                Case 11
                    If IgnoreIDocDirective Then
                        value = 11001
                    Else
                        value = 11000
                    End If
                Case Else
                    Exit Sub
            End Select
            Microsoft.Win32.Registry.SetValue(Microsoft.Win32.Registry.CurrentUser.ToString & BrowserKeyPath, _
                                              Process.GetCurrentProcess.ProcessName & ".exe", _
                                              value, _
                                              Microsoft.Win32.RegistryValueKind.DWord)
        End Sub
        Private Sub RemoveBrowerKey()
            Dim key As Microsoft.Win32.RegistryKey
            key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(BrowserKeyPath.Substring(1), True)
            key.DeleteValue(Process.GetCurrentProcess.ProcessName & ".exe", False)
        End Sub
    End Class 'MyApplication
End Namespace 'My
great, please send me youre skype or jabber by pm. I cant send, I think you can help me
and the credit goes to 😊
Sorry. but I forgot where I get that code.
(Jun 5, 2015 07:54 PM)Shikatanai Wrote:  Sorry. but I forgot where I get that code.

http://www.vbforums.com/showthread.php?7...ost4751775
(Jun 6, 2015 12:01 AM)frawg Wrote:  http://www.vbforums.com/showthread.php?7...ost4751775

Thank you 🤝 🤝
You should always give the credits if you are scarping code from elsewhere.Anyways this might come in handy
Can you give me an example on why you would use another webbrowser? If you're trying to make bots, I don't think webbrowser is the way to go! You should look into httpwebrequests.

[Image: X1okWX9.png]
(Jun 12, 2015 01:52 PM)3270 Wrote:  Can you give me an example on why you would use another webbrowser? If you're trying to make bots, I don't think webbrowser is the way to go! You should look into httpwebrequests.

Even though you are correct, do you understand what this thread is about?
[Image: jlscvfi.png]
(Jun 12, 2015 02:01 PM)NETExplorer Wrote:  Even though you are correct, do you understand what this thread is about?

No he doesn't and neither does OP
thanks dude !!!!!! i'm so thankfull
Thank you for this tutorial - you helped me 🙂
No problem mate. 🤝


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Shell] by Emre_Dec 12, 2020 05:18 AM 1 147 Dec 12, 2020 05:18 AM
Last Post: Dolla$
[Shell] by Emre_Nov 20, 2020 04:42 PM 0 128 Nov 20, 2020 04:42 PM
Last Post: Emre_
[.NET] by MatriculateMar 5, 2016 07:03 AM 6 236 Mar 5, 2016 07:03 AM
Last Post: Ninja