将结构保存在文件中 [英] save structure in file

查看:108
本文介绍了将结构保存在文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.
我有这个结构

Hello every body.
I have this structure

public struct person
       {
           public string name;
           public string family;
           public string tel;
           public int education;
       }


推荐答案

通常,您需要使用序列化.您可以阅读有关它的信息,但我会特别推荐数据合同.请参阅:
http://en.wikipedia.org/wiki/Serialization#.NET_Framework [ http://msdn.microsoft.com/en-us/library/ms733127.aspx [ ^ ].

还请参阅我过去的答案,在此我提倡使用这种功能强大且易于使用的方法:
如何在我的表单应用程序? [ ^ ],
创建属性文件... [反序列化json字符串数组 [
Generally, you need to use serialization. You can read about it, but I would specifically recommend Data Contract. Please see:
http://en.wikipedia.org/wiki/Serialization#.NET_Framework[^],
http://msdn.microsoft.com/en-us/library/ms733127.aspx[^].

Please also see my past answers where I advocate this powerful and easy-to-use way:
How can I utilize XML File streamwriter and reader in my form application?[^],
Creating property files...[^],
deseralize a json string array[^].

—SA


这篇关于将结构保存在文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆