如何编辑应用程序配置设置? App.config中最好的路要走?最好的、要走、应用程序、编辑

由网友(空城空收空心人)分享简介:有关我的项目,我有我通过设置在项目属性中添加的设置。 For my project I have settings that I added through the Settings in the project properties. 我很快发现,编辑app.config文件直接似乎没有真正更新的设置值。看来我...

有关我的项目,我有我通过设置在项目属性中添加的设置。

For my project I have settings that I added through the Settings in the project properties.

我很快发现,编辑app.config文件直接似乎没有真正更新的设置值。看来我,当我做出改变,然后重新编译以查看项目属性。

I quickly discovered that editing the app.config file directly seems to no really update the settings value. Seems I have to view the project properties when I make a change and then recompile.

我不知道......什么是最佳 和最简单的方式来处理自定义设置 一个项目 - 认为这将 是想都不用想有怎样的.Net 处理它...羞辱我。

I'm wondering ... what is the best and easiest way to handle customizable settings for a project -- thought this would be a no-brainer with how .Net handles it ... shame on me.

是否有可能使用一 设置,的AppSettings 的applicationSettings 或 UserSettings 来处理呢?

Is it possible to use one of the settings, AppSettings, ApplicationSettings, or UserSettings to handle this?

是更好地只写我的设置自定义配置文件和处理自己的事情?

Is it better to just write my settings to custom config file and handle things myself?

现在... 我在找最快的解决办法!

我的环境是C#,净3.5和Visual Studio 2008。

更新

我试图做到以下几点:

    protected override void Save()
    {
        Properties.Settings.Default.EmailDisplayName = this.ddEmailDisplayName.Text;
        Properties.Settings.Default.Save();
    }

给我一个只读的错误,当我编译。

Gives me a read-only error when I compile.

推荐答案

这是愚蠢的......,我想我将不得不道歉浪费大家的时间!但它看起来像我只需要为设置范围用户,而不是应用程序,我可以写新的价值。

This is silly ... and I think I am going to have to apologize for wasting everyone's time! But it looks like I just need to set the scope to User instead of Application and I can the write the new value.

阅读全文

相关推荐

最新文章