代码拉取完成,页面将自动刷新
unit Unit5;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ComCtrls, IniFiles;
type
TForm5 = class(TForm)
RichEdit1: TRichEdit;
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form5: TForm5;
Root: string;
DataIni: TIniFile;
implementation
{$R *.dfm}
procedure TForm5.FormClose(Sender: TObject; var Action: TCloseAction);
var
i: longint;
begin
with DataIni do begin
EraseSection('NotePaper');
WriteInteger('NotePaper', 'Width', Width);
WriteInteger('NotePaper', 'Height', Height);
for i := 0 to RichEdit1.Lines.Count - 1 do begin
WriteString('NotePaper', IntToStr(i), RichEdit1.Lines[i]);
end;
end;
end;
procedure TForm5.FormCreate(Sender: TObject);
begin
Root := ExtractFileDir(Application.ExeName);
DataIni := TIniFile.Create(Root + '/Savedata.ini');
Width := DataIni.ReadInteger('NotePaper', 'Width', 400);
Height := DataIni.ReadInteger('NotePaper', 'Height', 400);
Left := 800;
Top := 300;
end;
procedure TForm5.FormShow(Sender: TObject);
var
i: longint;
linestr: string;
begin
i:=0;
RichEdit1.Lines.Clear;
while true do begin
linestr := DataIni.ReadString('NotePaper', IntToStr(i), 'EOF');
if linestr = 'EOF' then break;
RichEdit1.Lines.Add(linestr);
inc(i);
end;
end;
end.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。