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

📄 u_login.pas

📁 以多个信息系统为例
💻 PAS
字号:
unit u_login;interfaceuses  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,  Db, DBTables, StdCtrls, Buttons, ExtCtrls, Mask;type  TF_login = class(TForm)    Panel1: TPanel;    Label1: TLabel;    Label2: TLabel;    Label3: TLabel;    Label4: TLabel;    i_server: TComboBox;    i_passwd: TEdit;    B_login: TBitBtn;    B_cancel: TBitBtn;    i_user: TMaskEdit;    procedure B_loginClick(Sender: TObject);    procedure FormShow(Sender: TObject);  private    { Private declarations }  public    { Public declarations }  end;var  F_login: TF_login;implementationuses u_main, u_datamodule, crypt;{$R *.DFM}procedure TF_login.B_loginClick(Sender: TObject);var  passwd:String;begin  With DM_main do  begin    Database.Params.Values['SERVER NAME']:=i_server.Text;    Database.Connected:=True;    passwd:=i_passwd.Text;    passwd:=Copy(passwd+passwd,1,10);    passwd:=Encrypt(passwd,123);    Q_login.Params.ParamValues['USER']:=i_user.Text;    Q_login.Params.ParamValues['PASSWD']:=passwd;    Q_login.Open;    if Q_login['COUNT']=1 then    begin      Q_login.Close;      F_main.Show;      F_login.Hide;    end    else    begin  //认证失败      Application.MessageBox('请确认用户名和密码,注意大小写!', '认证失败',MB_OK);      Database.Connected:=False;    end;  end;end;procedure TF_login.FormShow(Sender: TObject);begin  DM_main.Database.Connected:=False;end;end.

⌨️ 快捷键说明

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