📄 login.pas
字号:
unit login;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DBCtrls, DB, DBTables;
type
TLoginForm = class(TForm)
Label1: TLabel;
Label2: TLabel;
pwd: TEdit;
OKBtn: TButton;
CancelBtn: TButton;
DataSource1: TDataSource;
UserTable: TTable;
Name: TDBComboBox;
private
{ Private declarations }
public
{ Public declarations }
function canPass:boolean;
end;
var
LoginForm: TLoginForm;
implementation
{$R *.dfm}
function TLoginForm.canPass: boolean;
var
V: Variant;
A: String;
begin
Result := False;
V := UserTable.Lookup('Name',
Name.Text,
'Password');
if not (VarType(V) in [varNull]) then begin
A := V;
if A = Pwd.Text then begin
Result := True;
Exit;
end;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -