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