Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Registry Access Question
Message
De
14/06/2008 00:44:01
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01324009
Message ID:
01324075
Vues:
13
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform