unit2.~pas

来自「简单的学生管理系统」· ~PAS 代码 · 共 65 行

~PAS
65
字号
unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, DBTables, StdCtrls, Buttons;

type
  TlogoForm = class(TForm)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    Table1: TTable;
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  logoForm: TlogoForm;

implementation

{$R *.dfm}

procedure TlogoForm.BitBtn1Click(Sender: TObject);
begin
   with table1 do
   begin
   open;
   filtered:=false;
   filter:='用户名='+''''+edit1.Text+'''''and 密码='+edit2.Text+'''';
   filtered:=true;
   if recordcount=0 then
   begin
   messagebeep(1);
   showmessage('用户名或密码不正确,请重新输入用户名和密码!');
   filtered:=false;
   edit1.SetFocus;
   close;
   end
   else
   begin
   modalresult:=1;
   close;

   end;
   end ;
end;

procedure TlogoForm.BitBtn2Click(Sender: TObject);
begin
application.Terminate;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?