{******************************************************************} { PswdDlg.pas } { } { Author : A.Nasir Senturk } { Home Page : http://www.shenturk.com } { Email : shenturk@gmail.com } { } { Date : 03.01.2007 } { Update : 22.03.2007 } { } { Sizden iki şey rica edicem: } { 1. Lutfen bu baslik kismini kaldirmayiniz. } { 2. Mumkunse bagis yapiniz. } { *****************************************************************} unit PswdDlg; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls, ExtCtrls; type TPasswordForm = class(TForm) GroupBox2: TGroupBox; Label2: TLabel; UserEdit: TLabeledEdit; PassEdit: TLabeledEdit; RetryEdit: TLabeledEdit; OkBtn: TButton; CancelBtn: TButton; procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); private { Private declarations } public { Public declarations } procedure SaveOptions; end; { var PasswordForm: TPasswordForm; } implementation uses OptnsDlg, ConstDef; {$R *.dfm} procedure TPasswordForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin if ModalResult = mrOK then begin if PassEdit.Text <> RetryEdit.Text then begin Application.MessageBox(sPassMismatch, sErrorText, MB_ICONERROR); RetryEdit.SetFocus; CanClose := False; Exit; end; if UserEdit.Text = '' then begin Application.MessageBox(sUserCannotEmpty, sErrorText, MB_ICONERROR); UserEdit.SetFocus; CanClose := False; Exit; end; if PassEdit.Text = '' then begin Application.MessageBox(sPassCannotEmpty, sErrorText, MB_ICONERROR); PassEdit.SetFocus; CanClose := False; Exit; end; { if Pos(' ', UserEdit.Text) > 0 then begin MessageDlg('Kullanıcı adında geçersiz karakter!', mtError, [mbOk], 0); UserEdit.SetFocus; CanClose := False; Exit; end; } SaveOptions; IniFile.UpdateFile; end else CanClose := True; end; procedure TPasswordForm.SaveOptions; begin RijndaelEncrypt(UserEdit.Text + ' ' + PassEdit.Text); end; end.