473,383 Members | 1,725 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Read from Registry on Vista

I'm using this approach to read from registry.
Dim f As New RegistryPermission(RegistryPermissionAccess.AllAcc ess, _
"HKEY_LOCAL_MACHINE\SOFTWARE\SRS
Enterprises\Coordinator\Settings")
'Vlad 02/12/2007
Dim f2 As New
RegistryPermission(RegistryPermissionAccess.AllAcc ess, _
"HKEY_CURRENT_USER\Software\Classes\VirtualStore\M ACHINE\SOFTWARE\SRS
Enterprises\Coordinator\Settings")

Dim pRegKey As RegistryKey = Registry.LocalMachine
pRegKey.OpenSubKey("SOFTWARE\\SRS
Enterprises\\Coordinator\\Settings")
Dim val As Object = pRegKey.GetValue("CSSLQN")

It works on Windows XP, on Windows Server 2003. It doesn't work on Vista
Business. pRegKey.GetValue("CSSLQN") returns null. The key with value
exists.

What should I add to my code to get the value from a registry?
Thank you

Vovan
Feb 13 '07 #1
11 3556
After the registry permission declaration you don't use demand or assert.
So, you declare it but never use it

Dim f As New RegistryPermission(RegistryPermissionAccess.AllAcc ess,
"HKEY_LOCAL_MACHINE\SOFTWARE\SRS Enterprises\Coordinator\Settings")

f.Demand() ' Personally I use ASSERT because at the end you can use
f.RevertAssert(), but you cannot do that with Demand()

Please try & post back

--
Newbie Coder
(It's just a name)
Feb 13 '07 #2
Thank you
I tried both one by one. I still get null from the key.

Vovan

"Newbie Coder" <ne*********@spammeplease.comwrote in message
news:uj**************@TK2MSFTNGP02.phx.gbl...
After the registry permission declaration you don't use demand or assert.
So, you declare it but never use it

Dim f As New RegistryPermission(RegistryPermissionAccess.AllAcc ess,
"HKEY_LOCAL_MACHINE\SOFTWARE\SRS Enterprises\Coordinator\Settings")

f.Demand() ' Personally I use ASSERT because at the end you can use
f.RevertAssert(), but you cannot do that with Demand()

Please try & post back

--
Newbie Coder
(It's just a name)


Feb 13 '07 #3
First of all, why do you set the permissions to all access when you are just
reading? Second, why are you using \\ instead of \ ?

maybe you need to proofread your doce

steve

"vovan" <so*****@vovan.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
I'm using this approach to read from registry.
Dim f As New RegistryPermission(RegistryPermissionAccess.AllAcc ess, _
"HKEY_LOCAL_MACHINE\SOFTWARE\SRS
Enterprises\Coordinator\Settings")
'Vlad 02/12/2007
Dim f2 As New
RegistryPermission(RegistryPermissionAccess.AllAcc ess, _

"HKEY_CURRENT_USER\Software\Classes\VirtualStore\M ACHINE\SOFTWARE\SRS
Enterprises\Coordinator\Settings")

Dim pRegKey As RegistryKey = Registry.LocalMachine
pRegKey.OpenSubKey("SOFTWARE\\SRS
Enterprises\\Coordinator\\Settings")
Dim val As Object = pRegKey.GetValue("CSSLQN")

It works on Windows XP, on Windows Server 2003. It doesn't work on Vista
Business. pRegKey.GetValue("CSSLQN") returns null. The key with value
exists.

What should I add to my code to get the value from a registry?
Thank you

Vovan
Feb 13 '07 #4
vb dotnet does not run on Vista; you better rewrite your shit in VB6

-Larry

Feb 13 '07 #5
I found the sample of the code a couple of years ago. I replaced its values
with my values and it worked right away.
Since that I never had any problem with that code before Vista.
I use it in Windows Service project.
I tested it in Windows Form project. It works on Vista.
So the same code does work in Windows Form project on Vista, in any project
before Vista and doesn't work in Windows Service project on Vista.
What's the difference?

Vovan

"Steve Cochran" <sc******@oehelp.comwrote in message
news:03**********************************@microsof t.com...
First of all, why do you set the permissions to all access when you are
just reading? Second, why are you using \\ instead of \ ?

maybe you need to proofread your doce

steve

"vovan" <so*****@vovan.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>I'm using this approach to read from registry.
Dim f As New RegistryPermission(RegistryPermissionAccess.AllAcc ess, _
"HKEY_LOCAL_MACHINE\SOFTWARE\SRS
Enterprises\Coordinator\Settings")
'Vlad 02/12/2007
Dim f2 As New
RegistryPermission(RegistryPermissionAccess.AllAc cess, _

"HKEY_CURRENT_USER\Software\Classes\VirtualStore\ MACHINE\SOFTWARE\SRS
Enterprises\Coordinator\Settings")

Dim pRegKey As RegistryKey = Registry.LocalMachine
pRegKey.OpenSubKey("SOFTWARE\\SRS
Enterprises\\Coordinator\\Settings")
Dim val As Object = pRegKey.GetValue("CSSLQN")

It works on Windows XP, on Windows Server 2003. It doesn't work on Vista
Business. pRegKey.GetValue("CSSLQN") returns null. The key with value
exists.

What should I add to my code to get the value from a registry?
Thank you

Vovan

Feb 13 '07 #6
Yes it does.

Robin S.
---------------------------------
"Larry Linson" <la***********@hotmail.comwrote in message
news:11*********************@s48g2000cws.googlegro ups.com...
vb dotnet does not run on Vista; you better rewrite your shit in VB6

-Larry

Feb 13 '07 #7
I guess they got more specific in what they would allow and not allow or
what was conventional or not. I don't know, but the error is probably due
to the double slashes.

steve

"vovan" <so*****@vovan.comwrote in message
news:uP**************@TK2MSFTNGP03.phx.gbl...
>I found the sample of the code a couple of years ago. I replaced its values
with my values and it worked right away.
Since that I never had any problem with that code before Vista.
I use it in Windows Service project.
I tested it in Windows Form project. It works on Vista.
So the same code does work in Windows Form project on Vista, in any
project before Vista and doesn't work in Windows Service project on Vista.
What's the difference?

Vovan

"Steve Cochran" <sc******@oehelp.comwrote in message
news:03**********************************@microsof t.com...
>First of all, why do you set the permissions to all access when you are
just reading? Second, why are you using \\ instead of \ ?

maybe you need to proofread your doce

steve

"vovan" <so*****@vovan.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>>I'm using this approach to read from registry.
Dim f As New RegistryPermission(RegistryPermissionAccess.AllAcc ess, _
"HKEY_LOCAL_MACHINE\SOFTWARE\SRS
Enterprises\Coordinator\Settings")
'Vlad 02/12/2007
Dim f2 As New
RegistryPermission(RegistryPermissionAccess.AllA ccess, _

"HKEY_CURRENT_USER\Software\Classes\VirtualStore \MACHINE\SOFTWARE\SRS
Enterprises\Coordinator\Settings")

Dim pRegKey As RegistryKey = Registry.LocalMachine
pRegKey.OpenSubKey("SOFTWARE\\SRS
Enterprises\\Coordinator\\Settings")
Dim val As Object = pRegKey.GetValue("CSSLQN")

It works on Windows XP, on Windows Server 2003. It doesn't work on Vista
Business. pRegKey.GetValue("CSSLQN") returns null. The key with value
exists.

What should I add to my code to get the value from a registry?
Thank you

Vovan

Feb 13 '07 #8
I tried single slashes before my original post. The same problem.

Vovan

"Steve Cochran" <sc******@oehelp.comwrote in message
news:up**************@TK2MSFTNGP04.phx.gbl...
>I guess they got more specific in what they would allow and not allow or
what was conventional or not. I don't know, but the error is probably due
to the double slashes.

steve

"vovan" <so*****@vovan.comwrote in message
news:uP**************@TK2MSFTNGP03.phx.gbl...
>>I found the sample of the code a couple of years ago. I replaced its
values with my values and it worked right away.
Since that I never had any problem with that code before Vista.
I use it in Windows Service project.
I tested it in Windows Form project. It works on Vista.
So the same code does work in Windows Form project on Vista, in any
project before Vista and doesn't work in Windows Service project on
Vista.
What's the difference?

Vovan

"Steve Cochran" <sc******@oehelp.comwrote in message
news:03**********************************@microso ft.com...
>>First of all, why do you set the permissions to all access when you are
just reading? Second, why are you using \\ instead of \ ?

maybe you need to proofread your doce

steve

"vovan" <so*****@vovan.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl.. .
I'm using this approach to read from registry.
Dim f As New RegistryPermission(RegistryPermissionAccess.AllAcc ess, _
"HKEY_LOCAL_MACHINE\SOFTWARE\SRS
Enterprises\Coordinator\Settings")
'Vlad 02/12/2007
Dim f2 As New
RegistryPermission(RegistryPermissionAccess.All Access, _

"HKEY_CURRENT_USER\Software\Classes\VirtualStor e\MACHINE\SOFTWARE\SRS
Enterprises\Coordinator\Settings")

Dim pRegKey As RegistryKey = Registry.LocalMachine
pRegKey.OpenSubKey("SOFTWARE\\SRS
Enterprises\\Coordinator\\Settings")
Dim val As Object = pRegKey.GetValue("CSSLQN")

It works on Windows XP, on Windows Server 2003. It doesn't work on
Vista Business. pRegKey.GetValue("CSSLQN") returns null. The key with
value exists.

What should I add to my code to get the value from a registry?
Thank you

Vovan



Feb 13 '07 #9
sorry dude

vb 2002, 2003 and 2005 don't work on vista

welcome to visual fred, bitch you should have known better than to
trust MS


On Feb 12, 4:07 pm, "vovan" <some...@vovan.comwrote:
I'm using this approach to read from registry.
Dim f As New RegistryPermission(RegistryPermissionAccess.AllAcc ess, _
"HKEY_LOCAL_MACHINE\SOFTWARE\SRS
Enterprises\Coordinator\Settings")
'Vlad 02/12/2007
Dim f2 As New
RegistryPermission(RegistryPermissionAccess.AllAcc ess, _
"HKEY_CURRENT_USER\Software\Classes\VirtualStore\M ACHINE\SOFTWARE\SRS
Enterprises\Coordinator\Settings")

Dim pRegKey As RegistryKey = Registry.LocalMachine
pRegKey.OpenSubKey("SOFTWARE\\SRS
Enterprises\\Coordinator\\Settings")
Dim val As Object = pRegKey.GetValue("CSSLQN")

It works on Windows XP, on Windows Server 2003. It doesn't work on Vista
Business. pRegKey.GetValue("CSSLQN") returns null. The key with value
exists.

What should I add to my code to get the value from a registry?
Thank you

Vovan

Feb 14 '07 #10
I have similar code in VS 2005 and it works fine.

steve

"vovan" <so*****@vovan.comwrote in message
news:u7**************@TK2MSFTNGP05.phx.gbl...
>I tried single slashes before my original post. The same problem.

Vovan

"Steve Cochran" <sc******@oehelp.comwrote in message
news:up**************@TK2MSFTNGP04.phx.gbl...
>>I guess they got more specific in what they would allow and not allow or
what was conventional or not. I don't know, but the error is probably due
to the double slashes.

steve

"vovan" <so*****@vovan.comwrote in message
news:uP**************@TK2MSFTNGP03.phx.gbl...
>>>I found the sample of the code a couple of years ago. I replaced its
values with my values and it worked right away.
Since that I never had any problem with that code before Vista.
I use it in Windows Service project.
I tested it in Windows Form project. It works on Vista.
So the same code does work in Windows Form project on Vista, in any
project before Vista and doesn't work in Windows Service project on
Vista.
What's the difference?

Vovan

"Steve Cochran" <sc******@oehelp.comwrote in message
news:03**********************************@micros oft.com...
First of all, why do you set the permissions to all access when you are
just reading? Second, why are you using \\ instead of \ ?

maybe you need to proofread your doce

steve

"vovan" <so*****@vovan.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl. ..
I'm using this approach to read from registry.
Dim f As New RegistryPermission(RegistryPermissionAccess.AllAcc ess, _
"HKEY_LOCAL_MACHINE\SOFTWARE\SRS
Enterprises\Coordinator\Settings")
'Vlad 02/12/2007
Dim f2 As New
RegistryPermission(RegistryPermissionAccess.Al lAccess, _
>
"HKEY_CURRENT_USER\Software\Classes\VirtualSto re\MACHINE\SOFTWARE\SRS
Enterprises\Coordinator\Settings")
>
Dim pRegKey As RegistryKey = Registry.LocalMachine
pRegKey.OpenSubKey("SOFTWARE\\SRS
Enterprises\\Coordinator\\Settings")
Dim val As Object = pRegKey.GetValue("CSSLQN")
>
It works on Windows XP, on Windows Server 2003. It doesn't work on
Vista Business. pRegKey.GetValue("CSSLQN") returns null. The key with
value exists.
>
What should I add to my code to get the value from a registry?
Thank you
>
Vovan
>

Feb 21 '07 #11
no .NET does .NOT run on Vista

Vb6 works perfectly though

ROFL

man.. where do they get their strategy.. out of a cracker jack box?



On Feb 13, 10:01 am, "RobinS" <Rob...@NoSpam.yah.nonewrote:
Yes it does.

Robin S.
---------------------------------"Larry Linson" <larrylinso...@hotmail.comwrote in message

news:11*********************@s48g2000cws.googlegro ups.com...
vb dotnet does not run on Vista; you better rewrite your shit in VB6
-Larry

Mar 13 '07 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: BigAbility | last post by:
is there registry in Longhorn( vista) ? i heard about Registry will disappear in longhorn. is it true?
6
by: Steve Teeples | last post by:
I have a piece of code (written is Visual Studio 2005) that is only reading the Security EventLog. On Windows XP Professiona/Home this code works just fine. int numberOfEntries =...
3
by: Rob Latour | last post by:
The following snippet (vb.net 2005) is working just fine in xp but not in vista in xp it lists all related sub keys in the registry just fine. in vista it doesn't list certain ones (like...
2
robains
by: robains | last post by:
I've got an App that normally is "Run as administrator" once deployed to a client PC running Vista. Please don't go down the road of "you aren't supposed to do it that way, yada, yada, yada" as I...
2
by: =?Utf-8?B?UGV0ZQ==?= | last post by:
Hi, I have developed a VB application in VS2005 and deployed it sucessfully to XP using an MSI file built with a standard VS setup project. The MSI creates some keys under...
2
by: terryastone | last post by:
I have an application that reads some registry values stored in the Local Machine\Software\... key. In XP, I can see these values using RegEdit. In my application I can read the values at...
0
by: Nilam2477 | last post by:
In Vista OS the keys "DefaultUserName" & "DefaultDomainName" are not present under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\ Is there any other key in the...
6
by: sd | last post by:
hello I need to keep my app entry under HKEY_LOCAL_MACHINE\Software\MyApp. (to support for all users).I need to update one key under MYApp. When I attempt to set value for this key...
1
by: MrShadow | last post by:
G'Day, I've been trying to find an answer to this for a long time now and haven't been making any headway. I have a maintenance application that runs a defrag, checkdisk, windows updates etc in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.