quit_unit.~pas

来自「网上搜索来的进销存源码」· ~PAS 代码 · 共 70 行

~PAS
70
字号
unit Quit_Unit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, ExtCtrls, IdGlobal;

type
  TQuit_Form = class(TForm)
    ProgressBar1: TProgressBar;
    Timer1: TTimer;
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }

  public
    { Public declarations }
    procedure BackupDataBase;
  end;

var
  Quit_Form: TQuit_Form;

implementation

uses main_unit;

{$R *.dfm}




procedure TQuit_Form.BackupDataBase;
var
  BackUpFile: string;
  TmpStr: string;
  DestPath: string;
begin
  BackUpFile := 'backup.bak';
  DestPath := 'backup\';
  TmpStr := ExtractFilePath(Application.ExeName);
  if not DirectoryExists(TmpStr + DestPath) then
  begin
    try
      CreateDir(TmpStr + DestPath);
    except
    end;
  end;
  if FileExists(TmpStr + DestPath + BackUpFile) then
  begin
    try
      DeleteFile(TmpStr + DestPath + BackUpFile);
    except
    end;
  end;
  CopyFileTo(TmpStr + 'mdb\' + 'jxc.mdb', TmpStr + DestPath + BackUpFile);
end;

procedure TQuit_Form.Timer1Timer(Sender: TObject);
begin
  if ProgressBar1.Position >= 60 then
  begin
    Application.Terminate;
  end;
  ProgressBar1.Position := ProgressBar1.Position + 1;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?