C#中的文件(二进制文件)和类 [英] File(Binary files) and classe in c#

查看:195
本文介绍了C#中的文件(二进制文件)和类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我想在带有类的c#控制台中编写一个程序,然后对该类进行继承,最后将信息保存在file中.
实际上,我想编写一个包含类和二进制文件(4个直接访问权限)的电话簿(ID,名称,电话,电子邮件,地址)
但我完全不知道该如何编写程序.
请帮我.
感谢alot

hi everyone
i want to write a program in a Console at c# with classes and then inheritance over that class and at the end save information in file .
in fact , i want to Write a Phonebook(ID,Name,Tel,Email,Address) with classes and Binary files (4 Direct access)
but exactly I don''t know how to write this program.
please help me.
thanks alot

推荐答案

1)将要保存的内容分解为逻辑块. (不是代码,而是您在现实生活中如何看待它们).
2)在Visual Studio中创建项目.
3)采纳那些细分的概念并设计简单的来包装您所需的数据.在适当的地方使用继承.
3)从用户界面获取用户输入,并将数据值应用于类的实例.
4)将这些对象序列化到文件中.
5)当您在代码中遇到问题或在编写时遇到问题时,请专门询问这些问题,我们很乐意提供帮助,但我们不会为您编写代码.

干杯,祝你好运.
1) Break down the things you want to save into logical blocks. (Not code, just how you could look at them in real life).
2) Create your project in Visual Studio.
3) Take those broken down concepts and design simple classes to wrap the data you need for them. Use inheritance where applicable.
3) Get the user input from the UI and apply the data values to instances of your classes.
4) Serialize those objects to a file.
5) When you have issues in your code or run into issues while writing, ask about those specifically and we''ll be glad to provide assistance, but we won''t write it for you.

Cheers and good luck.


这篇关于C#中的文件(二进制文件)和类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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