?? unit3.pas
字號:
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls,StdCtrls, ExtCtrls, Gauges;
type
TForm2 = class(TForm)
GroupBox1: TGroupBox;
Gauge1: TGauge;
Image2: TImage;
Image3: TImage;
SaveDialog1: TSaveDialog;
OpenDialog1: TOpenDialog;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
var
i: integer;
DataFile: String;
begin
DataFile := GetCurrentDir+'\Data\XQ_Data.MDF';
try
if not savedialog1.Execute then exit;
if FileExists(savedialog1.FileName+'.mdf') then
begin
if Messagebox(handle,'存在數據庫重名,是否覆蓋?','存盤選項',mb_iconquestion+mb_yesno)=IDNo then Exit;
end
else
begin
for i:=Gauge1.MinValue to Gauge1.MaxValue do
Gauge1.Progress := i;
CopyFile(PChar(DataFile),PChar(SaveDialog1.FileName+'.mdb'),True);
Messagebox(handle,'數據庫備份成功!','備份數據',mb_iconinformation+mb_ok);
end;
except
Messagebox(handle,'警告:數據庫備份失敗!','存盤錯誤',mb_iconwarning+mb_ok);
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -