开发者

.Net application settings

I want to implement application settings to have them update settings that wont be set in a file i manage. I have the following so far:

In settings I have a variable named valuesforcomparison of type nameValueCollection and the scope is user. Now when I do the following the variable isnt updated the next time the user runs the program.

开发者_如何学C
       public  void UpdatePropertySettings(NameValueCollection settings)
       {
        Properties.Settings.Default.valuesforcomparison = new NameValueCollection();

        for (int i = 0; i < settings.Count; i++)
        {
            Properties.Settings.Default.valuesforcomparison.Add(settings.GetKey(i), settings.GetValues(i)[0]);
        }

        Properties.Settings.Default.Save();
        Properties.Settings.Default.Upgrade();

        defVals = settings;

    }


NameValueCollection isnt supported.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜