Unit15.pas
上传用户:szyozho
上传日期:2013-04-13
资源大小:3688k
文件大小:2k
源码类别:

教育系统应用

开发平台:

Delphi

  1. unit Unit15;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, StdCtrls, Buttons, ExtCtrls;
  6. type
  7.   Tbackupform = class(TForm)
  8.     Image1: TImage;
  9.     Label1: TLabel;
  10.     Label2: TLabel;
  11.     Label3: TLabel;
  12.     Label4: TLabel;
  13.     SpeedButton1: TSpeedButton;
  14.     Edit1: TEdit;
  15.     SaveDialog1: TSaveDialog;
  16.     BitBtn3: TBitBtn;
  17.     BitBtn4: TBitBtn;
  18.     Label5: TLabel;
  19.     Label6: TLabel;
  20.     Label7: TLabel;
  21.     Label8: TLabel;
  22.     procedure BitBtn1Click(Sender: TObject);
  23.     procedure SpeedButton1Click(Sender: TObject);
  24.     procedure BitBtn3Click(Sender: TObject);
  25.   private
  26.     { Private declarations }
  27.   public
  28.   
  29.     { Public declarations }
  30.   end;
  31. var
  32.   backupform: Tbackupform;
  33. implementation
  34. {$R *.dfm}
  35. procedure Tbackupform.BitBtn1Click(Sender: TObject);
  36. var
  37. failure:boolean;
  38. begin
  39. failure:=false;
  40. if not copyfile('D:delphizyDATAa',pchar(trim(edit1.Text)),false) then
  41.   failure:=true;
  42. if failure then
  43. ShowMessage('数据备份没有成功!')
  44. else
  45. showmessage('数据备份成功!');
  46. end;
  47. procedure Tbackupform.SpeedButton1Click(Sender: TObject);
  48. begin
  49. if SaveDialog1.Execute then
  50. Edit1.Text:=SaveDialog1.FileName;
  51. end;
  52. procedure Tbackupform.BitBtn3Click(Sender: TObject);
  53. var
  54. i:string;
  55. failure:boolean;
  56. begin
  57. failure:=false;
  58. i:=ExtractFilePath(Application.ExeName);
  59. if not copyfile(pchar(i+'abao'),pchar(trim(edit1.Text)),false) then
  60.   failure:=true;
  61. if failure then
  62. ShowMessage('数据备份没有成功!')
  63. else
  64. showmessage('数据备份成功!');
  65. end;
  66. end.