F: TextFile;
s:string;
Sl: tstringlist;
begin
if OpenDialog1.Execute then { Display Open dialog box }
begin
AssignFile(F, OpenDialog1.FileName); { File selected in dialog }
Reset(F);
while not eof(f) do
begin
Readln(F, S);
sl.add(s);
end;
CloseFile(F);
end;
end;
F: TextFile;
S: string;
begin
if OpenDialog1.Execute then { Display Open dialog box }
begin
AssignFile(F, OpenDialog1.FileName); { File selected in dialog }
Reset(F);
Readln(F, S); { Read first line of file }
Edit1.Text := S; { Put string in a TEdit control }
CloseFile(F);
end;
end;
Var
FList: TStringList;
tmpStr: String;
Begin
FList:= TStringList.Create;
FList.LoadFromFile(TextFileName);
for i:=0 to FList.count-1 do
showmessage(FList[i]);