home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / delphi / tenpack.lzh / CRYPDEMO.PAS < prev    next >
Pascal/Delphi Source File  |  1995-05-11  |  1KB  |  56 lines

  1. unit crypdemo;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, Buttons, FileCtrl, pscrypt;
  8.  
  9. type
  10.   TDemoCrypt = class(TForm)
  11.     FileCrypt1: TFileCrypt;
  12.     DriveComboBox1: TDriveComboBox;
  13.     DirectoryListBox1: TDirectoryListBox;
  14.     FileListBox1: TFileListBox;
  15.     Memo1: TMemo;
  16.     Edit1: TEdit;
  17.     Label2: TLabel;
  18.     Edit2: TEdit;
  19.     BitBtn1: TBitBtn;
  20.     BitBtn2: TBitBtn;
  21.     Label1: TLabel;
  22.     Label3: TLabel;
  23.     procedure BitBtn1Click(Sender: TObject);
  24.     procedure BitBtn2Click(Sender: TObject);
  25.   private
  26.     { Private declarations }
  27.   public
  28.     { Public declarations }
  29.   end;
  30.  
  31. var
  32.   DemoCrypt: TDemoCrypt;
  33.  
  34. implementation
  35.  
  36. {$R *.DFM}
  37.  
  38. procedure TDemoCrypt.BitBtn1Click(Sender: TObject);
  39. begin
  40.  
  41.    Filecrypt1.password := edit2.text;
  42.    Filecrypt1.filename := edit1.text;
  43.    Filecrypt1.cryptfile;
  44.    If BitBtn1.Caption = '&Encrypt' then
  45.      BitBtn1.Caption := '&Decrypt'
  46.    else
  47.      BitBtn1.Caption := '&Encrypt';
  48. end;
  49.  
  50. procedure TDemoCrypt.BitBtn2Click(Sender: TObject);
  51. begin
  52.      Memo1.lines.LoadFromFile(edit1.text);
  53. end;
  54.  
  55. end.
  56.