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 }
S := Edit2.Text;
Writeln(F, S); { Write }
CloseFile(F);
end;
end;
델파이 예제에도 나와있는데요...
var
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 }
S := Edit2.Text;
Writeln(F, S); { Write }
CloseFile(F);
end;
end;
^^ 항상 즐코하세요...