开发者

Access web.config key from codebehind

I have a key in the web.config file like:

<add key="MailFrom" value="my@email.com"/>

I need to 开发者_StackOverflowaccess it in the code behind.How to do this in c#?


You could use the AppSettings property indexer:

string from = ConfigurationManager.AppSettings["MailFrom"];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜