【发布时间】:2016-11-06 21:35:34
【问题描述】:
我正在尝试使用 C# .Net 保存和加载 ListView 列表的内容。我希望通过创建一个变量 System.Windows.Forms.ListView 然后用它填充它来保存它。
用于保存的代码 sn-p:
Properties.Settings.Default.followedUsersSettings = followerList;
Properties.Settings.Default.Save();
加载代码 sn-p:
if (Properties.Settings.Default.followedUsersSettings != null) {
followerList = Properties.Settings.Default.followedUsersSettings;
}
我似乎无法使用该代码使其工作。有没有更好的方法来保存这个尽可能简单?该列表是单列,因此 Array 也应该可以工作,但我不确定推荐什么。
【问题讨论】:
-
什么是followerList?
-
内容是什么?只是一个字符串列表还是有子项?
-
@TaW 内容只是使用 System.Windows.Forms.Listview 的简单字符串列表。没有子项
标签: c# .net listview persistent-storage