How to get a List collection of values from app.config in WPF?

前端 未结 7 1122
执笔经年
执笔经年 2020-11-28 22:42

The following example fills the ItemsControl with a List of BackupDirectories which I get from code.

How can I change this

7条回答
  •  执念已碎
    2020-11-28 23:25

    In App.config:

    
    

    In C#:

    string[] InFormOfStringArray = ConfigurationManager.AppSettings["YOURKEY"].Split(',').Select(s => s.Trim()).ToArray();
    List list = new List(InFormOfStringArray);
    

提交回复
热议问题