Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleDetermine whether the system has Internet Explorer configured to use a proxy in Visual Basic .NET
DescriptionThis example shows how to determine whether the system has Internet Explorer configured to use a proxy in Visual Basic .NET.
Keywordsproxy, IE, Internet Explorer, Registry, key, VB.NET
CategoriesInternet, 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
 
 
Copyright © 1997-2006 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated