Hey guys,
I'm looking to enable and/or disable a proxy by button in a program. I have looked at the msdn examples but can't figure out how to navigate to:
hkey_current_user\Software\microsoft\windows\currentversion\internet settings
This is my current code:
Just trying different things, I tried setting the viewandmodify to HKEY_Current_User then use the OpenSubKey but that didn't work either :SCode:Imports Microsoft.VisualBasic
Imports System
Imports System.Security.Permissions
Imports Microsoft.Win32
<Assembly: RegistryPermissionAttribute(SecurityAction.RequestMinimum, ViewAndModify:="HKEY_CURRENT_USER\Microsoft\Windows\CurrentVersion\Internet Settings")>
Public Class Form1
Dim Test As RegistryKey
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Test.OpenSubKey("Test")
'Test.OpenSubKey("Windows")
'Test.OpenSubKey("CurrentVersion")
'Test.OpenSubKey("Internet Settings")
Test.SetValue("ProxyEnable", 1)
'Test.SetValue("Level", "Intermediate")
'Test.SetValue("ID", 123)
'Test.Close()
My.Computer.Registry.CurrentUser.CreateSubKey("Test")
End Sub
End Class
Any help would be great
Mita
