FILESTREAM

xiaoxiao2021-03-06  72

procedure TForm1.Button1Click (Sender: TObject); var f1: TFileStream; filename: String; begin OpenDialog1.Execute; filename: = OpenDialog1.FileName; f1: = TfileStream.Create (filename, fmopenread); try RichEdit1.Lines.LoadFromStream ( F1); f1.position: = 0; Memo1.Lines.LoadFromstream (F1); Finally F1.Free; end;

END;

procedure TForm1.Button2Click (Sender: TObject); var f1: TFileStream; filename: string; begin savedialog1.Execute; filename: = saveDialog1.FileName; f1: = TFilestream.Create (filename, FmCreate); try RichEdit1.Lines.SaveToStream ( F1);

Finally f1.free; end;

转载请注明原文地址:https://www.9cbs.com/read-109137.html

New Post(0)