Unit16.pas
上传用户:szyozho
上传日期:2013-04-13
资源大小:3688k
文件大小:1k
- unit Unit16;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, Buttons, ExtCtrls;
- type
- Trestoreform = class(TForm)
- Image1: TImage;
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- Edit1: TEdit;
- SpeedButton1: TSpeedButton;
- OpenDialog1: TOpenDialog;
- BitBtn1: TBitBtn;
- BitBtn2: TBitBtn;
- Label5: TLabel;
- Label6: TLabel;
- Label7: TLabel;
- Label8: TLabel;
- procedure SpeedButton1Click(Sender: TObject);
- procedure BitBtn1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- restoreform: Trestoreform;
- implementation
- {$R *.dfm}
- procedure Trestoreform.SpeedButton1Click(Sender: TObject);
- begin
- if self.OpenDialog1.Execute then
- edit1.Text:=self.OpenDialog1.FileName;
- end;
- procedure Trestoreform.BitBtn1Click(Sender: TObject);
- var
- i:string;
- failure:boolean;
- begin
- failure:=false;
- i:=ExtractFilePath(Application.ExeName);
- if fileexists(pchar(i+'abao')) then
- begin
- deletefile(pchar(i+'abao'));
- if not copyfile(pchar(trim(edit1.Text)),pchar(i+'abao'),false) then
- failure:=true;
- end;
- if failure then
- ShowMessage('数据恢复没有成功!')
- else
- showmessage('数据恢复成功!');
- end;
- end.