I always seem to forget how to parse an enum, so here's the code for doing it in 2.0:
enum ConfigurationType
{
Internal,
WebConfigXml,
Win32Xml
};
string strConfigType = System.Configuration.ConfigurationSettings.AppSettings["ConfigurationType"].ToString();
ConfigurationType configType = (ConfigurationType)Enum.Parse(typeof(ConfigurationType), strConfigType);
Wednesday, October 04, 2006
Subscribe to:
Post Comments (Atom)
Fixes to common .NET problems, as well as information on .NET features and solutions to common problems that are not language-specific.
Fixes to common .NET problems, as well as information on .NET features and solutions to common problems that are not language-specific.
No comments:
Post a Comment