문제

I use the built-in Settings file to store the state of controls on form.

I use System.collections.Specialized.StringCollection and would like to use a list of int values.

Is there a way to do so?

도움이 되었습니까?

해결책

There is no List<T> in the settings, so you have to convert it yourself:

var strings = Properties.Settings.Default.Strings; // your StringCollection 
List<int> ints = strings.Cast<string>().Select(str => int.Parse(str)).ToList();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top