procedure TForm1.Button1Click(Sender: TObject);
//将指定文件读入memo1
var
mystr:Tfilestream;
begin
if opendialog1.Execute then
begin
mystr:=Tfilestream.create
(opendialog1.filename,fmopenread);
try
memo1.lines.LoadFromStream(mystr);
finally
mystr.Free;
end;
end;
end;