如何将添加到LIstView的项目保存到TextFile [英] How do I save items added to LIstView to TextFile
问题描述
每个人的好日子
我创建了一个Windows -Forms - 应用程序,应用程序,列表书籍和音频(磁带,乙烯基)以及详细信息和通行证从用户收到的值到ListView控件。我想保存传递给LIstView控件的值,在文本文件中,然后能够加载带有值的textFile,在应用程序加载时返回ListView。
我正在使用visual studio 2012,并用C#编写。
任何帮助都会非常感激。
谢谢
Good Day Everyone
I have created a Windows -Forms - application, the application, list books, and audio(tapes, vinyl's) and there details and passes the values received from the user, to a ListView Control. I want to save the values passed to the LIstView control, in a text File, and then be able to load that textFile's with the values, back to ListView when application loads.
I am using visual studio 2012, and writing in C#.
any help would really be appreciated.
Thank you
推荐答案
换句话说,你想要序列化 ListView,但请不要。请参阅代码项目Q& A
:[C#]序列化和反序列化ListView [ ^ ]。
In other words you want serialize the ListView, but, please don't. See this Code Project Q&A
: "[C#] serializing and deserializing a ListView"[^].
我建议你阅读:自定义数据绑定,第1部分 [ ^ ]。这是一篇非常有趣的文章,它可以帮助您了解如何将数据绑定到ListView控件。
I'd suggest to read this: Custom Data Binding, Part 1[^]. This is very interesting article, which might help you to understand how to bind data to ListView control.
这篇关于如何将添加到LIstView的项目保存到TextFile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!