Delphi读取文本内容

program Project2;

uses
  Windows;

var
  MyTextFile : TextFile;
  ALine : string;
begin
  AssignFile(MyTextFile,'FileName.Txt');
  Reset(MyTextFile);
  ReadLn(MyTextFile,ALine);
  MessageBox(0, PChar(Aline), '', 0);
end.

你可能感兴趣的:(Delphi)