P
pantagruel
Hi,
I'm trying to read a registry key:
I've tried:
RegistryKey rkey1 = rkey.OpenSubKey(
"SYSTEM\\CurrentControlSet\\Services\\Rendering Service");
then
RegistryKey rkey1 = rkey.OpenSubKey(
"SYSTEM\\CurrentControlSet\\Services\\Rendering Service\\");
due to problems
I've tried
RenderingQ = rkey1.GetValue("RenderingQOnDemandQ");
which gave an error when compiling of
Error 6 Cannot implicitly convert type 'object' to 'string'. An
explicit conversion exists (are you missing a cast?)
which seems weird, from the documentation I thought GetValue returned
a string?
so I tried:
RenderingQ = rkey1.GetValue("RenderingQOnDemandQ").ToString();
that compiles.
When I run it however I get a null value exception (the same situation
exists for all the various keys I'm working with)
if I do a registry dump of the key I'm working with I get:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Rendering
Service]
and
"RenderingQOnDemandQ"="C:\\RenditionServerQ\\QueueManagerQ\\OnDemandQ"
So I suppose there is something simple that i don't know about working
with the registry in .Net that someone can help me with?
Is it a casting exception?
How should I cast?
I'm trying to read a registry key:
I've tried:
RegistryKey rkey1 = rkey.OpenSubKey(
"SYSTEM\\CurrentControlSet\\Services\\Rendering Service");
then
RegistryKey rkey1 = rkey.OpenSubKey(
"SYSTEM\\CurrentControlSet\\Services\\Rendering Service\\");
due to problems
I've tried
RenderingQ = rkey1.GetValue("RenderingQOnDemandQ");
which gave an error when compiling of
Error 6 Cannot implicitly convert type 'object' to 'string'. An
explicit conversion exists (are you missing a cast?)
which seems weird, from the documentation I thought GetValue returned
a string?
so I tried:
RenderingQ = rkey1.GetValue("RenderingQOnDemandQ").ToString();
that compiles.
When I run it however I get a null value exception (the same situation
exists for all the various keys I'm working with)
if I do a registry dump of the key I'm working with I get:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Rendering
Service]
and
"RenderingQOnDemandQ"="C:\\RenditionServerQ\\QueueManagerQ\\OnDemandQ"
So I suppose there is something simple that i don't know about working
with the registry in .Net that someone can help me with?
Is it a casting exception?
How should I cast?