Hi i have got the following app.config
.
How do i get the values for smtp server mail subject etc.
string filePath = ConfigurationManager.AppSettings["SmtpServer"]; i'm getting nothing
actually added key values also the output returned null.
Hi i have got the following app.config
.
How do i get the values for smtp server mail subject etc.
string filePath = ConfigurationManager.AppSettings["SmtpServer"]; i'm getting nothing
actually added key values also the output returned null.
It's Simple
1st You set web.config or app.config file value like this.
<appSettings>
<add key="SmtpServer" value="abc" />
</appSettings>
then get value.
string filePath = Convert.ToString(ConfigurationManager.AppSettings["SmtpServer"]);
Or Same as app.config file
string filePath = System.Configuration.ConfigurationManager.AppSettings["SmtpServer"];