Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning int, string, logical, ? from method
Message
De
22/05/2008 12:15:31
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Returning int, string, logical, ? from method
Divers
Thread ID:
01319040
Message ID:
01319040
Vues:
61
Hi all,

I am trying to hide some complexity from the application within a settings Manager class. I want to have a method to return a value based on a setting name. The problem is the value may be an integer, string, logical, decimal, double, or datetime. What is the best way to do this so I can use a single method available to the app for obtaining these? A call might look like this:
serialPort.Name = oSettingsManager.GetSettingByName("RfidPort");

Or do I have only the option of returning everything as an object?
serialPort.Name = oSettingsManager.GetSettingByName("RfidPort").ToString();
Thanks for any thoughts
Tim
Timothy Bryan
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform