Store String Array In appSettings?

前端 未结 5 1730
借酒劲吻你
借酒劲吻你 2020-11-29 07:57

I\'d like to store a one dimensional string array as an entry in my appSettings. I can\'t simply separate elements with , or | because

5条回答
  •  温柔的废话
    2020-11-29 08:57

    You could use the AppSettings with a System.Collections.Specialized.StringCollection.

    var myStringCollection = Properties.Settings.Default.MyCollection;
    foreach (String value in myCollection)
    { 
        // do something
    }
    

    Each value is separated by a new line.

    Here's a screenshot (german IDE but it might be helpful anyway)

    enter image description here

提交回复
热议问题