那样我可以用Write(TouchFile,APerson)的形式一次写入一条结构类型的数据
touchfile文件句柄或指针之类
如个人信息
struct APerson
{
string name;
int age;
string address;
等等
}
哪位给予解答,非常感谢,我只知道 struct Record
{
public string name;
public UInt16 age;
public string phone;
public string address;
}; //通讯录的记录格式
f_srm = new FileStream(s_filename,FileMode.OpenOrCreate);
BinaryWriter pw = new BinaryWriter(f_srm);
pw.Seek(0,SeekOrigin.End);
string s_temp;
m_record.name = Console.ReadLine();
pw.Write(m_record.name);
这么写,我想能一次写入一个结构的数据