⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit20.pas

📁 高校图书管理系统采用Delphi结合数据库
💻 PAS
字号:
unit Unit20;

interface

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

type
  Tfrm_yhdr = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
    Button1: TButton;
    Button2: TButton;
    Edit2: TEdit;
    Query1: TQuery;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frm_yhdr: Tfrm_yhdr;

implementation

uses Unit1;

{$R *.dfm}

procedure Tfrm_yhdr.Button1Click(Sender: TObject);
begin
if (edit1.Text='') or(edit2.text='')then
  begin
  application.MessageBox('请输入用户名或密码!','提示',0);
  exit;
  end
else
query1.Close;
query1.SQL.Clear;
query1.SQL.add('select * from xtb.db where username=:Num');
query1.ParamByName('Num').Value:=edit1.Text;
query1.Open;
if query1.Eof then
  application.MessageBox('用户名不存在,请重输!','提示',0)
 else if query1.FieldByName('Password').Value=edit2.Text  then
    begin
      frm_yhdr.Visible:=false;
      frm_main.show;
    end
  else
  application.MessageBox('密码错误,请重输!','提示',0);
 edit1.Text:='';
 edit2.Text:='';
end;
procedure Tfrm_yhdr.Button2Click(Sender: TObject);
var
a:word;
begin
a:=application.MessageBox('是否退出本系统?','提示!',mb_yesno);
if a=idyes then
 frm_yhdr.Close
 else frm_yhdr.Show;
end;

end.

⌨️ 快捷键说明

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