type Your Record Name=record str1:string[16]; str2:string[10]; end; var connectfile:file of Your Record Name; connectdate:Your Record Name; myconnect:string; var i:integer; begin myconnect:=文件名; assignfile(connectfile,myconnect); if not fileExists(myconnect) then begin FileHandle:=filecreate(myconnect); try fileclose(filehandle); assignfile(connectfile,myconnect); reset(connectfile); connectdate.str1:=内容; connectdate.str2:=内容 Write(connectfile,connectdate); fileclose(filehandle); except Messagedlg('File Can''t Create!',mtError,[mbOk],0); end; end else try reset(connectfile); except Messagedlg('File Can''t Open!!',mtError,[mbOk],0); end; 查找用seek你查查书吧!别的我也不记得了!
Your Record Name=record
str1:string[16];
str2:string[10];
end;
var
connectfile:file of Your Record Name;
connectdate:Your Record Name;
myconnect:string;
var
i:integer;
begin
myconnect:=文件名;
assignfile(connectfile,myconnect);
if not fileExists(myconnect) then
begin
FileHandle:=filecreate(myconnect);
try
fileclose(filehandle);
assignfile(connectfile,myconnect);
reset(connectfile);
connectdate.str1:=内容;
connectdate.str2:=内容
Write(connectfile,connectdate);
fileclose(filehandle);
except
Messagedlg('File Can''t Create!',mtError,[mbOk],0);
end;
end
else
try
reset(connectfile);
except
Messagedlg('File Can''t Open!!',mtError,[mbOk],0);
end;
查找用seek你查查书吧!别的我也不记得了!