【文件属性】:
文件名称:Delphi读取文件和写入文件总结
文件大小:10KB
文件格式:TXT
更新时间:2015-04-18 16:40:05
Delphi 读取文件 写入 文件 总结
示例:
procedure TForm1.Button1Click(Sender: TObject);
var
pMyFile:textfile;
pStr : string;
begin
if OpenDialog1.Execute then begin
Assignfile(pMyFile,OpenDialog1.FileName);
Reset(pMyFile);
while not Eof(pMyFile) do begin
Readln(pMyFile,pStr);
//fn_DelStock(pStr); //使用读取的字符串相关语句
next;
end;
CloseFile(pMyFile);
end;
end;
网友评论
- 亲测有用,可以参考