I am trying to make it to where it will read the registry and report back if ProxyEnable is set to the value of 1. If it is, it replies back that the privacy is in risk, if not it says privacy is safe.

Here is my code. Any help with this would be much appreciated. Thanks!

Dim regkey2 As RegistryKey

        regkey2 = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings")
        Dim proxyEnabled As String

        proxyEnabled = regkey2.GetValue("ProxyEnable").ToString()

        MsgBox("Proxy server is enabled. Your privacy is at risk!")
2 Years
Discussion Span
Last Post by powerade661

You can get the value as an integer by

Dim key As String = "HKEY_CURRENT_USER\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"
Dim proxyEnabled As Long = My.Computer.Registry.GetValue(key, "ProxyEnable", Nothing)

If proxyEnabled <> 0 Then
    MsgBox("Proxy server is enabled. Your privacy is at risk!")
End If

Thank you very much Reverend Jim. I appreciate it. So I assume the <> 0 Then means greater than or less than 0 then display that message? Am I reading your code correctly?

Edited by powerade661: Capitalization error


Jim, this doesn't seem to work. I enabled the proxy and it does not detect it as being enabled. Any ideas?


Yes. The <> 0 means greater to or less than (in other words, not equal to) zero. When you enable the proxy does the value of the registry item change to a non-zero value?

Edited by Reverend Jim


Yes it does. I don't understand why it's not working..


This is what it says. Capture3.PNG


Ok umm now it's working. It could just be because I was debugging too soon. I don't really know why but it works fine now. Interesting... Sorry about that. Thank you for your help. :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.