qiehuan.pas

来自「这个程序是用Delphi编写的」· PAS 代码 · 共 66 行

PAS
66
字号
unit qiehuan;

interface

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

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

var
  PopForm: TPopForm;

implementation
  uses unit1,stu_use;
{$R *.dfm}

procedure TPopForm.Button1Click(Sender: TObject);
var
results:boolean ;
begin
  ADOTable1.Close ;
  ADOTable1.Open ;
  ADOTable1.Active;
  if edit1.Text='' then
  application.MessageBox('用户名不能为空','提示',mb_ok)
  else if edit2.Text='' then
  application.messagebox('密码不能为空','警告',mb_ok)
  else
  if ADOTable1.Locate('users'+';'+'password',VarArrayOf([Edit1.Text,Edit2.Text]),[locaseinsensitive]) then
  begin
   user_no := Edit1.Text ;
   Form4.Show ;
   close ;
  end
  else
  showmessage('密码错误或用户不存在');
  edit1.Clear ;
  edit2.Clear ;

end;

procedure TPopForm.Button2Click(Sender: TObject);
begin
Form4.Close ;
close ;
end;

end.

⌨️ 快捷键说明

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