|
|
Title | Determine whether the system has Internet Explorer configured to use a proxy in Visual Basic .NET |
Description | This example shows how to determine whether the system has Internet Explorer configured to use a proxy in Visual Basic .NET. |
Keywords | proxy, IE, Internet Explorer, Registry, key, VB.NET |
Categories | Internet, Tips and Tricks, VB.NET |
|
|
Internet Explorer lets you specify proxy settings. In the Tools menu, select Internet Options. Select the Connections tab and click the LAN Settings button. The goal is to figure out if the box indicated by the arrow in the picture is checked.
Function InternetProxyEnabled looks at the Registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings. If the value of ProxyEnable is not 0, then the box is checked.
|
|
' Return True if the internet settings has ProxyEnable =
' True.
Private Function InternetProxyEnabled() As Boolean
' See if Internet Explorer uses a proxy.
Dim key As RegistryKey = _
Registry.CurrentUser.OpenSubKey( _
"Software\\Microsoft\\Windows\\CurrentVersion\\Internet " & _
"Settings")
Dim keys() As String = key.GetValueNames()
Dim result As Boolean = _
(CInt(key.GetValue("ProxyEnable", 0)) <> 0)
key.Close()
Return result
End Function
|
|
|
|
|
|