Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fwd: vb .net, registry, HKLM\System\CurrentControlSet, Security

18 views
Skip to first unread message

DuboisP

unread,
Jul 8, 2010, 6:29:46 AM7/8/10
to

---- Message Usenet réexpédié ----
De: DuboisP <patrickr.dubois.don't.s...@free.fr.invalid>
Forum: microsoft.public.dotnet.languages.vb
Sujet: vb .net, registry, HKLM\System\CurrentControlSet, Security
Date: Fri, 02 Jul 2010 19:37:46 +0200
URL: message://<op.ve78k9o3ilk2x8@frrdamid430p>

Hello

I'm writing a small program un vb.net 2005, and i need a read access to
the keys of HKLM\System\ControlSet\Enum.
It's working under Windows2000 and probably XP, but not with Vista and
Seven, where the securities are stronger.
It must work for regular users

Here the piece of code, and i have a security violation

Dim regPermission As RegistryPermission
regPermission = New RegistryPermission(RegistryPermissionAccess.Read,
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum")
regPermission.SetPathList(RegistryPermissionAccess.Read,
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum")

oCurrentKey = Registry.LocalMachine
oCurrentKey = oCurrentKey.OpenSubKey("SYSTEM\CurrentControlSet\Enum")
oSubKeyNames = oCurrentKey.GetSubKeyNames()

What's wrong ?
Is it possible ?

Thanks

Patrick


--
Utilisant le client e-mail révolutionnaire d'Opera :
http://www.opera.com/mail/

0 new messages