Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
First of Thank you so much for help me in my previous work.
This time I am here with new question.
I am trying to make a vpn software which change internet explorer Proxy setting by updating registry values.
i have code as given below

VB
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports Microsoft.Win32
Imports System.Runtime.InteropServices



Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim SystemRegistry As RegistryKey = _
    Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurretnVersion\\Internet Settings", True)

        If SystemRegistry.GetValue("ProxyEnable", 0) Then
            SystemRegistry.SetValue("ProxyEnable", 1)
            SystemRegistry.SetValue("ProxyServer", "154.25.253.12:8080")
        Else
            MsgBox("Proxy Error")

        End If



    End Sub

End Class

it shows no error in code but While I am trying to run the App it shows error

"Object reference not set to an instance of an object."
Please Help me with this error
Posted

currentversion 
spelt wrong
 
Share this answer
 
If this is an copy of your code its a simple typo: you wrote curretnVersion instead if currentVersion. So it can't be found during runtime. At compilation it's just a string so no error is shown the .
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900