var
myFile : TextFile;
text : String;
sFileName : String;
begin
sFileName := 'F:/test.txt';
AssignFile(myFile, sFileName);
if FileExists(sFileName) then
Append(myFile)// 以追加的方式打开文件
else
ReWrite(myFile);
Writeln(myFile, 'Hello World, By Bob!');
Writeln(myFile, FormatDateTime('yyyy/mm/dd hh:nn:ss', now));
CloseFile(myFile);
ReSet(myFile);
while not Eof(myFile) do
begin
Readln(myFile, text);
showmessage(text);
end;
CloseFile(myFile);
end;
posted on 2010-02-09 15:42
Ke 阅读(284)
评论(0) 编辑 收藏 所属分类:
delphi