home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / mail / mailx6 / _setup.1 / password.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-03-19  |  1.2 KB  |  56 lines

  1. unit password;
  2.  
  3. interface
  4.  
  5. uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, 
  6.   Buttons;
  7.  
  8. type
  9.   TPasswordDlg = class(TForm)
  10.     Label1: TLabel;
  11.     Password: TEdit;
  12.     OKBtn: TButton;
  13.     CancelBtn: TButton;
  14.     Label2: TLabel;
  15.     Password2: TEdit;
  16.     procedure OKBtnClick(Sender: TObject);
  17.   private
  18.     { Private declarations }
  19.   public
  20.     { Public declarations }
  21.   end;
  22.  
  23. var
  24.   PasswordDlg: TPasswordDlg;
  25.  
  26. implementation
  27.  
  28. uses demo95fr;
  29. {$R *.DFM}
  30.  
  31. procedure TPasswordDlg.OKBtnClick(Sender: TObject);
  32. begin
  33.      if Password.Text='' then
  34.      begin
  35.           MessageBox(0,'You can''t set current Password','Change Password',MB_ICONINFORMATION);
  36.           ModalResult:=mrNONE;
  37.           Exit;
  38.      end;
  39.  
  40.      If Password.Text<>Password2.Text then
  41.      begin
  42.           MessageBox(0,'Incorrect Passwords','Change Password',MB_ICONSTOP);
  43.           ModalResult:=mrNONE;
  44.           Exit;
  45.      end;
  46.  
  47.      FormWin95.MXSession1.ChangePassword:= Password.Text;
  48.      If FormWin95.MXSession1.ErrorNum = 0 Then
  49.         MessageBox(0,'Password Changed!!!', 'Mail eXtension', 64)
  50.      Else
  51.          MessageBox(0,'Unable to Set Password', 'Change Password',MB_ICONQUESTION);
  52. end;
  53.  
  54. end.
  55.  
  56.