DColin
asked on
Set Internet Explorer proxy settings from VB.Net code
Hi Experts,
How do I turn on/off the Internet Explorer Proxy settings from my VB.Net code.
How do I turn on/off the Internet Explorer Proxy settings from my VB.Net code.
ASKER
Hi mahadevan_v
When I use your code I get an 'objHost not declared' error. I notice from your code that you do not declare the objHost object. Do I need to import a namespace?
When I use your code I get an 'objHost not declared' error. I notice from your code that you do not declare the objHost object. Do I need to import a namespace?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If objHost.DirectConnection = False Then
Dim regKey As RegistryKey
regKey = Registry.CurrentUser.OpenS
regKey.SetValue("ProxyEnab
regKey.SetValue("ProxyServ
If objHost.BypassLocal Then
regKey.SetValue("ProxyOver
Else
regKey.DeleteValue("ProxyO
End If
regKey.Close()
Else
MessageBox.Show("Network Switcher is currently not configured to use a proxy server. " + ControlChars.CrLf + _
"Please open Network Switcher settings dialog and configure the proxy server.", "Missing proxy settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation
End If
End Sub
Public Sub DisableProxy()
Dim regKey As RegistryKey
regKey = Registry.CurrentUser.OpenS
regKey.SetValue("ProxyEnab
regKey.Close()
End Sub
RESTART THE IE Instance :)