📄 pass.pas
字号:
unit pass;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Db, DBTables, Buttons;
type
Tpasswordform = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
ComboBox1: TComboBox;
Label2: TLabel;
Edit1: TEdit;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
Database1: TDatabase;
Table1: TTable;
Table2: TTable;
procedure BitBtn1Click(Sender: TObject);
private
times:integer;
{ Private declarations }
public
{ Public declarations }
end;
var
passwordform: Tpasswordform;
implementation
{$R *.DFM}
procedure Tpasswordform.BitBtn1Click(Sender: TObject);
var
s,s2:string;
begin
times:=times+1;
s:=combobox1.Text;
s2:=edit1.text;
if times<=3 then
begin
if (s<>'系统管理员') and (s<>'普通用户') then
showmessage('你输入了无效的操作员账号')
else
begin
if (table1.FindKey([s])) and (table1.fieldbyname('password').asstring=s2)
then
begin
table2.First;
table2.edit ;
table2.FieldByName('username').asstring:=s;
table2.Post;
modalresult:=mrok
end
else
begin
showmessage('您输入了错误的密码');
edit1.text:='';
end;
end;
end
else
application.Terminate;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -