📄 setpass.pas
字号:
unit setpass;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
DosMove, StdCtrls, Buttons, db,adodb,ExtCtrls;
type
Tsetpassf = class(TForm)
Panel1: TPanel;
Label1: TLabel;
Label2: TLabel;
Label4: TLabel;
passwd1: TEdit;
passwd2: TEdit;
Passwd3: TEdit;
ExitCmd: TBitBtn;
OkCmd: TBitBtn;
tDosMove1: tDosMove;
Image1: TImage;
share_qry: TADOQuery;
procedure passwd1KeyPress(Sender: TObject; var Key: Char);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure OkCmdClick(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
setpassf: Tsetpassf;
implementation
uses data,global;
{$R *.DFM}
procedure Tsetpassf.passwd1KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
if OpratorPassWord<>passwd1.Text then
begin
application.MessageBox('原口令错误!请重新输入。','提示信息',mb_IconWarning+mb_ok);
passwd1.SelectAll ;
passwd1.SetFocus ;
exit;
end else
passwd2.SetFocus ;
end;
procedure Tsetpassf.FormClose(Sender: TObject; var Action: TCloseAction);
begin
action:=cafree;
end;
procedure Tsetpassf.OkCmdClick(Sender: TObject);
begin
if OpratorPassWord<>passwd1.Text then
begin
application.MessageBox('原口令错误!请重新输入。','提示信息',mb_IconWarning+mb_ok);
passwd1.SelectAll ;
passwd1.SetFocus ;
exit;
end
else if passwd2.Text <>passwd3.Text then
begin
application.MessageBox('新口令输入错误!','提示信息',mb_Iconwarning+mb_ok);
passwd2.SelectAll ;
passwd2.SetFocus ;
exit;
end else
begin
try
dataf.adocon.BeginTrans ;
share_qry.close; share_qry.sql.clear;
share_qry.sql.add('Update yhm set 口令=:p_NewPassword ');
share_qry.Parameters.ParamByName('p_newPassword').value:=passwd2.Text ;
share_qry.ExecSQL ;
dataf.adocon.CommitTrans ;
OpratorPassWord:=passwd2.Text ;
except
dataf.adocon.RollbackTrans ;
raise;
end;
application.MessageBox('口令修改成功!','提示信息',mb_IconInformation+mb_ok);
close;
end;
end;
procedure Tsetpassf.FormDestroy(Sender: TObject);
begin
setpassf:=nil;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -