Can I store a variable array of strings inside application settings file in C#?
I want to store a list of 10-20 elements inside application configuration file in a C# appli开发者_C百科cation. I realize that I can use add key tags in appsettings section, but then I will have to create a unique key for each.
I am planning to loop over the elements in a section, and tried storing it. but it fails it initialize confiuration managager
EDIT: I want to store a section for table names to verify , where user can enter a list of tables to run a test on each
You can create your own IConfigurationSectionHandler.
- MSDN Tutorial
- Code Project Tutorial (This directly references multiple values, and may be more helpful with what you're going for)
EDIT
Just as an aside, this may be more work that you need given your last edit. You could just use a delimiter not found in the acceptable identifier list and split the string. (probably a whole lot easier)
精彩评论