我可以在Web配置中动态配置这些值吗 [英] can i configure these values dynamically in the web config

查看:55
本文介绍了我可以在Web配置中动态配置这些值吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<configuration>
<appSettings>
<add key="SMTP" value="xxxx" />

<add key="EMailSendTime" value="18:20" />
<add key="QueryGeneration" value="18:00" />
</appSettings>
</configuration>



基本上我是在做邮件调度的,上面的代码不是准确的,在这里我可以从数据库动态获取EMailSendTime的值.在代码中,我静态地使用此值,



basically iam doing mail scheduling, the above code is not acurate, here can i acquire the values of EMailSendTime dynamically from an database. in code i am using this value statically,

推荐答案

阅读以下页面:

http://stackoverflow.com/questions/719928/如何在运行时修改网络配置 [ http://www.a2zmenu.com/Blogs/CSharp/Modify%20webconfig% 20file%20at%20runtime.aspx [ ^ ]

希望对您有所帮助.
read these pages :

http://stackoverflow.com/questions/719928/how-do-you-modify-the-web-config-appsettings-at-runtime[^]

http://www.a2zmenu.com/Blogs/CSharp/Modify%20webconfig%20file%20at%20runtime.aspx[^]

Hope it helps.


这篇关于我可以在Web配置中动态配置这些值吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆