Delphi 中记录文件怎么用?(50分)

  • 主题发起人 主题发起人 lwluser
  • 开始时间 开始时间
L

lwluser

Unregistered / Unconfirmed
GUEST, unregistred user!
请问 Delphi 中记录文件怎么用,能否举个例子,小弟先谢了!
 
type
Tuserpostrecord=record
username,password:string[16];
userage:string[3];
usersex:Boolean;
usermail:string[30];
useraddress:string[50];
userqqnum:string[10];
end;



procedure Tuserdatafrm.Button1Click(Sender: TObject);

var
userpost1:Tuserpostrecord;
userpostfile:file of Tuserpostrecord;
userpostpathname:string;
//打开用户资料文件名
begin
assignfile(userpostfile,userpostpathname);
if fileexists(userpostpathname) then reset(userpostfile)
else
rewrite(userpostfile);
//确定用户名是否已经存在

while not eof(userpostfile) do
begin

read(userpostfile,userpost1);
end;
end;
找书看!
 
后退
顶部