简体   繁体   English

如何在C#中将multidim数组保存到Properties.settings

[英]How do I save an multidim array to Properties.settings in C#

How do I save multidimensional array to Properties.Settings? 如何将多维数组保存到Properties.Settings? If I can't do this or can't it easily, how can I save a single dimensional array to Properties.Settings? 如果无法执行此操作或无法轻松执行此操作,如何将一维数组保存到Properties.Settings?

Properties.Settings has a System.Collection.Specialized.StringCollection that you can use. Properties.Settings具有您可以使用的System.Collection.Specialized.StringCollection It does not have anything for multidimensional arrays. 对于多维数组,它没有任何内容。 To save you will need to iterate through your array and use StringCollection.Add method to add each element of your array to the collection. 为了保存,您将需要遍历数组并使用StringCollection.Add方法将数组的每个元素添加到集合中。

See here 看这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM