Error reading Registry, please very urgent

J

Joao Santa Barbara

Hi all

i have this error reading one registry key , can anyone assist me .. please
very urgent

i try in one computer, and work fine, but in other computer it didn´t work
and throws this error ..???


"Request for the permission of type
System.Security.Permissions.RegistryPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed."


USing this function

Public Function ReadProgramValueFromRegistry(ByVal Value As String) As
Object

Dim Reg As Microsoft.Win32.Registry

Dim RegKey As Microsoft.Win32.RegistryKey

RegKey = Reg.LocalMachine.OpenSubKey(APPLICATION_CURRENT_REG_KEY)

Return RegKey.GetValue(Value)

End Function
 
J

Jon Skeet

Joao Santa Barbara said:
i try in one computer, and work fine, but in other computer it didn´t work
and throws this error ..???

Well, it looks like the user you're running it under doesn't have
permission to read that registry key - what happens if you try it with
just regedit?

Also, have a look at the .NET Configuration Wizard, and the permission
settings for Registry. (I don't know much about permission settings, so
you'll have to look in the help for how it all works.)
 
J

Joao Santa Barbara

thks for the help
i have adjust the permitions for the mscrolib .. :)

thks alot
JSB


Joao Santa Barbara said:
i try in one computer, and work fine, but in other computer it didn´t work
and throws this error ..???

Well, it looks like the user you're running it under doesn't have
permission to read that registry key - what happens if you try it with
just regedit?

Also, have a look at the .NET Configuration Wizard, and the permission
settings for Registry. (I don't know much about permission settings, so
you'll have to look in the help for how it all works.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top