unit1.pas

来自「检测interbase数据库是否损坏,并修复」· PAS 代码 · 共 48 行

PAS
48
字号
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    Label1: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  Close
end;

procedure TForm1.FormShow(Sender: TObject);
var
  DFile: string;
begin
 DFile := 'C:\Program Files\Borland\InterBase\borland.lic';
 if DeleteFile(DFile) then
   if CopyFileTo('borland.lic',DFile) then
     Label1.Caption := '修复完毕!'+#13+'(重新启动计算机才能生效)'
   else
     Label1.Caption := '修复失败!(复制出错)'
 else
   Label1.Caption := '修复失败!(删除出错)';
end;

end.

⌨️ 快捷键说明

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