用pascal的方法...
type
TMyRec = Record
i : integer;
s : string;
End;
var
MyRec : TMyRec;
fp : file of TMyRec;
begin
//写入文件
assignfile(fp,'文件路径');
rewrite(fp);
write(fp,myrec);
closefile(fp);
//读出文件
assignfile(fp,'文件路径');
reset(fp);
read(fp,myrec);
closefile(fp);
end;