Click here to Skip to main content
15,891,864 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralProblem Solved but not real cause found Pin
edmonson22-Jul-08 0:33
edmonson22-Jul-08 0:33 
GeneralRe: Problem Solved but not real cause found Pin
Vimalsoft(Pty) Ltd22-Jul-08 1:01
professionalVimalsoft(Pty) Ltd22-Jul-08 1:01 
GeneralRe: Problem Solved but not real cause found Pin
edmonson22-Jul-08 1:06
edmonson22-Jul-08 1:06 
GeneralRe: Problem Solved but not real cause found Pin
Vimalsoft(Pty) Ltd22-Jul-08 1:11
professionalVimalsoft(Pty) Ltd22-Jul-08 1:11 
QuestionGet value from child to parent window Pin
hemant.kaushal21-Jul-08 0:53
hemant.kaushal21-Jul-08 0:53 
AnswerRe: Get value from child to parent window Pin
C1AllenS21-Jul-08 1:29
C1AllenS21-Jul-08 1:29 
QuestionSending a spreadsheet as PDF Pin
Dalek Dave20-Jul-08 23:39
professionalDalek Dave20-Jul-08 23:39 
QuestionHow to autostart up my vb application inside the system registry without "The specified RegistryKeyPermissionCheck value is invalid" [modified] Pin
vbDigger'z20-Jul-08 22:31
vbDigger'z20-Jul-08 22:31 
How to autostart up my vb application inside the system registry without "The specified RegistryKeyPermissionCheck value is invalid"

i have created and experimenting a vb2005 win application which i need to auto start up when windows run.. so programmatically i have a code communicating in the system registry?? i can read from HK_LocalMachine SubKey's and KeyName and KeyValue's but then when my application attempt to create/write a KeyName with it's corresponding KeyValue?? this give an error like this:

The specified RegistryKeyPermissionCheck value is invalid

Parameter name: mode

microsoft.win32.registrykey.validatekeymode(registrykeypermissioncheckmode)


'********** here's my experiment vb code reading and creating KeyName/KeyValue in the windows start up... i've just learned this from other post...
'******************

<br />
<br />
Imports System.IO<br />
Imports Microsoft.Win32<br />
Imports System.Security.Permissions<br />
<br />
Public Class MySampleApplication<br />
    Private Sub CreateKey()<br />
            Dim regKey As RegistryKey<br />
            Dim KeyName As String = "MySampleApplication"<br />
            Dim KeyValue As String = "C:\MySampleApplicationFolder"<br />
<br />
            regKey = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True, Security.AccessControl.RegistryRights.SetValue)<br />
<br />
            If regKey.GetValue(KeyName) = Nothing Then<br />
                'if there's no KeyName yet? then create and set it's value<br />
                MsgBox("No value found")<br />
                regKey.SetValue(KeyName, KeyValue, RegistryValueKind.String)<br />
                MsgBox("key " & KeyName & " has been created")<br />
            Else<br />
                'if KeyName is already existing? then verified it KeyValue<br />
                MsgBox("Value Found")<br />
                If regKey.GetValue(KeyName) = KeyValue Then<br />
                    'if KeyName is already existing and KeyValue is the same? DO NOTHING<br />
                    MsgBox("value equal")<br />
                Else<br />
                    'if KeyName is already existing but the KeyValue is diff from the original? then remodified to it's original path..<br />
                    MsgBox("value not equal")<br />
                    regKey.SetValue(KeyName, KeyValue, RegistryValueKind.String)<br />
                    MsgBox("key " & KeyName & " value has been remodified and back to its original application path")<br />
                End If<br />
            End If<br />
        Catch ex As Exception<br />
            MsgBox(ex.ToString)<br />
        End Try<br />
    End Sub<br />
End Class<br />

'****************************

Please anybody there who have any good idea with this??? im just newbie in registry manipulation using VB2005.. please forgive me from being ignorant.. im just trying to level up my programming skills...

Please any body help please??.... it's urgent.. i need this in my programming project case study...

modified on Monday, July 21, 2008 4:54 AM

AnswerRe: How to autostart up my vb application inside the system registry without "The specified RegistryKeyPermissionCheck value is invalid" Pin
jzonthemtn21-Jul-08 1:34
jzonthemtn21-Jul-08 1:34 
QuestionRe: How to autostart up my vb application inside the system registry without "The specified RegistryKeyPermissionCheck value is invalid" Pin
schrader@fsu.edu21-Jul-08 5:51
schrader@fsu.edu21-Jul-08 5:51 
AnswerRe: How to autostart up my vb application inside the system registry without "The specified RegistryKeyPermissionCheck value is invalid" Pin
vbDigger'z21-Jul-08 14:13
vbDigger'z21-Jul-08 14:13 
GeneralRe: How to autostart up my vb application inside the system registry without "The specified RegistryKeyPermissionCheck value is invalid" [modified] Pin
vbDigger'z21-Jul-08 14:41
vbDigger'z21-Jul-08 14:41 
GeneralRe: How to autostart up my vb application inside the system registry without "The specified RegistryKeyPermissionCheck value is invalid" Pin
jzonthemtn21-Jul-08 14:49
jzonthemtn21-Jul-08 14:49 
GeneralRe: How to autostart up my vb application inside the system registry without "The specified RegistryKeyPermissionCheck value is invalid" Pin
vbDigger'z21-Jul-08 15:22
vbDigger'z21-Jul-08 15:22 
GeneralRe: How to autostart up my vb application inside the system registry without "The specified RegistryKeyPermissionCheck value is invalid" Pin
vbDigger'z21-Jul-08 15:49
vbDigger'z21-Jul-08 15:49 
QuestionDeveloping EMail Proxy Server Pin
Jats_4ru20-Jul-08 19:20
Jats_4ru20-Jul-08 19:20 
GeneralSource Code in Visual Basic 6.0 for Webcam display for higher resolution cameras Pin
Clement Victor20-Jul-08 18:50
Clement Victor20-Jul-08 18:50 
GeneralRe: Source Code in Visual Basic 6.0 for Webcam display for higher resolution cameras Pin
Christian Graus20-Jul-08 19:27
protectorChristian Graus20-Jul-08 19:27 
GeneralRe: Source Code in Visual Basic 6.0 for Webcam display for higher resolution cameras Pin
Steven J Jowett21-Jul-08 7:19
Steven J Jowett21-Jul-08 7:19 
QuestionReflection, InvokeMethod, and Method 'Example.My.MyApplication.Main' not found. [modified] Pin
DanGetz20-Jul-08 18:43
DanGetz20-Jul-08 18:43 
QuestionGet current date from other pc Pin
klaydze20-Jul-08 16:35
klaydze20-Jul-08 16:35 
AnswerRe: Get current date from other pc Pin
Navneet Hegde21-Jul-08 0:06
Navneet Hegde21-Jul-08 0:06 
AnswerRe: Get current date from other pc Pin
jzonthemtn21-Jul-08 1:27
jzonthemtn21-Jul-08 1:27 
AnswerRe: Get current date from other pc Pin
Vimalsoft(Pty) Ltd21-Jul-08 3:50
professionalVimalsoft(Pty) Ltd21-Jul-08 3:50 
GeneralRe: Get current date from other pc Pin
klaydze21-Jul-08 14:52
klaydze21-Jul-08 14:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.