How do I check to see if an Application Setting is available?
i.e. app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key ="someKey" value="someValue"/>
</appSettings>
</configuration>
and in the codefile
if (ConfigurationManager.AppSettings.ContainsKey("someKey"))
{
// Do Something
}else{
// Do Something Else
}
Upper options gives flexible to all manner, if you know key type try parsing them
bool.TryParse(ConfigurationManager.AppSettings["myKey"], out myvariable);