?? cw_mm.~pas
字號:
unit cw_mm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, DBTables, StdCtrls, ExtCtrls;
type
TForm45 = class(TForm)
Label1: TLabel;
Panel1: TPanel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Button1: TButton;
Button2: TButton;
oldpass: TEdit;
newpass: TEdit;
newpass2: TEdit;
Q_pass: TQuery;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form45: TForm45;
implementation
{$R *.dfm}
procedure TForm45.Button1Click(Sender: TObject);
begin
if trim(newpass.Text)=trim(newpass2.Text) then
begin
Q_pass.Active:=False;
Q_pass.SQL.Clear;
Q_pass.SQL.Add('select * from manager where name='''+label6.Caption+'''');
Q_pass.Open;
if Q_pass.FieldByName('pass').AsString=trim(oldpass.Text) then
begin
Q_pass.Edit;
Q_pass['pass']:=trim(newpass.Text);
Q_pass.Post;
Q_pass.Close;
MessageDlg('密碼更改成功!',mtConfirmation,[mbok],0);
oldpass.Clear;
newpass.Clear;
newpass2.Clear;
close;
end
else
begin
MessageDlg('您輸入的原密碼不正確,請重新輸入!',mtError,[mbok],0);
oldpass.SetFocus;
end;
end
else
begin
MessageDlg('您兩次輸入的新密碼不一致,請重新輸入!',mtError,[mbok],0);
newpass.SetFocus;
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -