Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Registry Access Question
Message
From
14/06/2008 00:44:01
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01324009
Message ID:
01324075
Views:
12
>Now this is all fine when the registry value is a string, but it certainly isn't generic. What if the value is an int?

Have your method return an object rather than a string.

~~Bonnie



>I have this code:
>
>
>public string GetRegistryValue(string sKeyName, string sKeyValue)
>{
>    sKeyPath = "Software\\my_app\\" + sKeyName;
>
>    string sRetVal = (string)Registry.LocalMachine.GetValue(sKeyPath, sKeyValue, "");
>
>    return sValue;
>}
>
>
>Now this is all fine when the registry value is a string, but it certainly isn't generic. What if the value is an int?
>
>
>Thanks
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform