Suppose we have
<appSettings>
<add key="RuleMaster" value="DataSource\RuleMaster.xml"/>
</appSettings>
To get the value from "RuleMaster", let us write the below code
public string GetSettingValue(string configKey)
{
try
{
return System.Configuration.ConfigurationManager.AppSettings[configKey].ToString();
}
catch (Exception ex)
{
return string.Empty;
}
}
Use it :
GetSettingValue("RuleMaster");