Private Sub CheckBox1_Check edChanged(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles CheckBox1.Check edChanged
Dim regKey As New Object
Dim strKeyValueHere As String
Dim strMyExePathAnd Name As String
Const strKeyRootPath As String = "SOFTWARE\Micro soft\Windows\Cu rrentVersion\Ru n\"
Const HKEY_LOCAL_MACH INE As Long = &H80000002
strKeyValueHere = "MyKey"
strMyExePathAnd Name = App.Path & "\FYP.Exe"
If CheckBox1.Check ed = True Then
If Not regKey.GetKeyVa lue(HKEY_LOCAL_ MACHINE, strKeyRootPath, strKeyValueHere , strMyExePathAnd Name) Then
regKey.UpdateKe y(HKEY_LOCAL_MA CHINE, strKeyRootPath, strKeyValueHere , strMyExePathAnd Name)
End If
End If
End Sub
above is my own startup coding. however it got some error about the "Name App is not declared". Is there someone can help me solve the problem?
Dim regKey As New Object
Dim strKeyValueHere As String
Dim strMyExePathAnd Name As String
Const strKeyRootPath As String = "SOFTWARE\Micro soft\Windows\Cu rrentVersion\Ru n\"
Const HKEY_LOCAL_MACH INE As Long = &H80000002
strKeyValueHere = "MyKey"
strMyExePathAnd Name = App.Path & "\FYP.Exe"
If CheckBox1.Check ed = True Then
If Not regKey.GetKeyVa lue(HKEY_LOCAL_ MACHINE, strKeyRootPath, strKeyValueHere , strMyExePathAnd Name) Then
regKey.UpdateKe y(HKEY_LOCAL_MA CHINE, strKeyRootPath, strKeyValueHere , strMyExePathAnd Name)
End If
End If
End Sub
above is my own startup coding. however it got some error about the "Name App is not declared". Is there someone can help me solve the problem?
Comment