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

📄 unit2.pas

📁 从同学哪里拷贝来的程序,毕业设计用的,大家看看,有帮助的哦
💻 PAS
字号:
unit Unit2;

interface

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

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

var
  login: Tlogin ;

implementation

uses Unit1, Unit3;

{$R *.dfm}

procedure Tlogin.Button1Click(Sender: TObject);
begin
table1.open;
table1.Filter:='姓名='+''''+trim(edit2.Text)+''''+' and 密码='+''''+trim(edit1.Text)+'''';
 table1.Filtered:=true;
 if table1.RecordCount>0 then
       begin
      if table1.FieldByName('权限').AsString='12345' then
       unright:='12345'
    else unright:='';
    username:=table1.fieldbyname('姓名').AsString;
    main.Show;
    login.Close;
    edit1.Text:='';
    edit2.Text:='';
   end
else
   begin
     showmessage('你的用户名或口令错误!');
     edit1.Text:='';
     edit2.Text:='';
     edit1.SetFocus;
   end;
end;

procedure Tlogin.Button2Click(Sender: TObject);
begin
application.Terminate;
end;

end.

⌨️ 快捷键说明

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