ghell
07-29-2006, 03:12 PM
I have written a little C# program to read off values from my registry using the Microsoft.Win32 namespace, this all goes well until i get to a DWORD value which shows up in regedit as (invalid DWORD value) so i look at modify binary data and notice that its about 300 bytes big (so its obviously not dword data, which makes sense)
However, I get no exception or error on reading these values with the Microsoft.Win32.RegistryKey.GetValue(string) method but the program just exits. No finally blocks occur, it doesnt crash, it doesnt throw any errors etc the program just totally exits.
Is there any way to get around this or predetermine if it will happen before trying to read the key? it still comes up as type "DWORD" if i use the .GetValueKind(string) method and I can't think of anything else to use. :confused:
Searching for help on the problem just found loads of software around for cleaning or fixing your registry not any answers i could actually use.
I could probably just edit the registry so that this particular key was a different type but I am trying to write a program which doesnt require this sort of action (and of course its not usually a good idea to go around deleting or changing keys and values which you don't like)
However, I get no exception or error on reading these values with the Microsoft.Win32.RegistryKey.GetValue(string) method but the program just exits. No finally blocks occur, it doesnt crash, it doesnt throw any errors etc the program just totally exits.
Is there any way to get around this or predetermine if it will happen before trying to read the key? it still comes up as type "DWORD" if i use the .GetValueKind(string) method and I can't think of anything else to use. :confused:
Searching for help on the problem just found loads of software around for cleaning or fixing your registry not any answers i could actually use.
I could probably just edit the registry so that this particular key was a different type but I am trying to write a program which doesnt require this sort of action (and of course its not usually a good idea to go around deleting or changing keys and values which you don't like)