app.config文件的概念 [英] The concept of app.config file

查看:108
本文介绍了app.config文件的概念的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


任何机构都可以建议我有关app.config文件的信息.
1)编译应用程序后,是否每次都将其复制到Debug(或Release)文件夹中?

2)应用程序是在应用程序启动时还是在加载每个Form时读取它吗?

3)在运行期间是否有可能重新读取它?

此信息将对我有很大帮助.

谢谢

Hi,
Could any body kindly advise me about the app.config file.
1)When application is complied, is it copied to Debug (or Release) folder everytime?

2)Does the application reads it at application start up only or on loading each Form?

3) Is there any possibility to re-read it during the run time?

This info will be of great help for me.

Thanks

推荐答案

1)
kfsehgal写道:
kfsehgal wrote:

当应用程序被编译时,是吗?每次都复制到Debug(或Release)文件夹吗?

When application is complied, is it copied to Debug (or Release) folder everytime?



是的,它已被复制.格式为:YourApp.Exe.Config

2)



Yes it is copied. And it would be of the form : YourApp.Exe.Config

2)

kfsehgal写道:
kfsehgal wrote:

应用程序是仅在应用程序启动时还是在加载每个Form时读取它吗?

Does the application reads it at application start up only or on loading each Form?



不完全是某一点.每当需要配置值时,都将读取它.我相信这不是一次性活动.

3)



Not exactly at one point. Whenever the configuration values are needed, it is read. I believe it''s not an one-time activity.

3)

kfsehgal写道:
kfsehgal wrote:

是否有可能在运行时重新读取它?

Is there any possibility to re-read it during the run time?



(上接第2个答案)您可以在应用程序的任何位置进行操作.

示例:
单击按钮,您可以读取如下配置值:



(Continued from answer#2) You can do it at any point of the application.

Example:
At a button click, you can read a configuration value like:

ConfigurationManager.AppSettings("KeyName")



希望这能澄清.

在此处阅读更多信息: http://generally.wordpress.com /2007/09/27/using-appconfig-for-user-defined-runtime-parameters/ [



Hope this clarifies.

Read more here: http://generally.wordpress.com/2007/09/27/using-appconfig-for-user-defined-runtime-parameters/[^]


这篇关于app.config文件的概念的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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