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

Visual Basic

 
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 
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 
Excuse me "The JZ" thanks for the reply.. i really appreciate your effort.. Smile | :) but i've try it before, before i've post this thread..

NOTE!!!!!!!! i forgot to say that this code work good in Windows 2000!! but does not work on "XP Pro SP3" or higher like "Vista".. and i want it to work with this OS platform... you can try my code and let me know if it will work on XP Pro SP2
anybody there got a good possible solution??

<br />
regKey = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)<br />


but this still gives me a security exception error like this... Dead | X|


System.UnauthorizedAccessExeption: Attempted to perform an unauthorized operation.
at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind value kind)


but just like i've said before from the very first of my thread? my code can only read but can't write on the registry... how am i suppose to write in the registry using Microsoft.Win32??? without having security exception error... my user account is already an administrator and i already set my application as a full trust application in PROJECT PROPERTIES/SECURITY/ENABLE CLICKONCE SECURITY SETTINGS as FULL TRUST APPLICATION of my WINDOW PROJECT IDE VS2005....

'*********** please review my code********
'***********this is my real actual code a little differ in my fisrt code which i just simplified before****

<br />
Imports System.IO<br />
Imports Microsoft.Win32<br />
Public Class myApplicationName<br />
    Private Sub CreateAutoRegistryKey()<br />
        Try<br />
            Dim regKey As RegistryKey<br />
<br />
            'NOte: appKeyName will be look like this "myApplicationName.exe"<br />
            Dim appKeyName As String = FileIO.FileSystem.GetName(Application.ExecutablePath)<br />
<br />
            'Note: then appKeyName will now look like this "myApplicationName"<br />
            appKeyName = appKeyName.Remove(appKeyName.IndexOf("."), 4)<br />
<br />
            regKey = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)<br />
<br />
            If regKey.GetValue(appKeyName) = Nothing Then<br />
                MsgBox("No value found")<br />
                regKey.SetValue(appKeyName, Application.ExecutablePath, RegistryValueKind.String)<br />
                MsgBox("key " & appKeyName & " has been created")<br />
            Else<br />
                MsgBox("Value Found")<br />
                If regKey.GetValue(appKeyName) = Application.ExecutablePath Then<br />
                    MsgBox("value equal")<br />
                Else<br />
                    MsgBox("value not equal")<br />
                    regKey.SetValue(appKeyName, Application.ExecutablePath, RegistryValueKind.String)<br />
                    MsgBox("key " & appKeyName & " value has been remodified")<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 help... please??...

modified on Monday, July 21, 2008 9:07 PM

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 
AnswerRe: Get current date from other pc Pin
Paul Conrad21-Jul-08 5:40
professionalPaul Conrad21-Jul-08 5:40 
QuestionCreateProcessWithLogonW and msi installer Pin
rogofreew20-Jul-08 12:26
rogofreew20-Jul-08 12:26 
AnswerRe: CreateProcessWithLogonW and msi installer Pin
Mycroft Holmes20-Jul-08 15:12
professionalMycroft Holmes20-Jul-08 15:12 
GeneralRe: CreateProcessWithLogonW and msi installer Pin
rogofreew20-Jul-08 20:18
rogofreew20-Jul-08 20:18 

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.