|
-
May 28th, 2009, 10:39 PM
#1
Thread Starter
Fanatic Member
save a dictionary to app.config
I'm trying to save a dictonary to app.config for my c# winform
I see that i can save a stringdictonary under collections.special but i heard thouse are to be avoided if possible becuase there legacy
is there a way to save a dictonary ( in this case string,string) to the app.config with out haveing to go through a lot of hoops?
thanks
-
May 28th, 2009, 10:52 PM
#2
Re: save a dictionary to app.config
A StringDictionary isn't legacy. It wouldn't be under a System namespace if it was. It was part of the Framework before generics existed so it tends not to be used these days but there's no specific reason not to use it. Just as you store a StringCollection in your settings rather than a List<string>, so too you store a StringDictionary rather than a Dictionary<string, string>. I'm fairly sure that application settings doesn't support generic collections at all, although I haven't tested that theory specifically.
Last edited by jmcilhinney; May 28th, 2009 at 10:54 PM.
Reason: Changed VB syntax to C#
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|