我想保存和加载使用C#.Net的ListView列表的内容。我希望通过创建一个变量System.Windows.Forms.ListView然后用它填充它来保存它。C#.Net保存一个ListView使用Settings.settings
保存代码片段:用于加载
Properties.Settings.Default.followedUsersSettings = followerList;
Properties.Settings.Default.Save();
代码片段:
if (Properties.Settings.Default.followedUsersSettings != null) {
followerList = Properties.Settings.Default.followedUsersSettings;
}
我似乎无法得到它使用代码工作。有没有更好的方法来保存这个尽可能简单的方法?该列表是单列,所以Array也应该可以工作,但我不确定推荐的是什么。
什么是followerList? – Damith
内容是什么?只是一个字符串列表或有子项? – TaW
@TaW内容只是一个简单的使用System.Windows.Forms.Listview的字符串列表。没有子条目 – Avendor7