Unit2.pas
资源名称:xiaobai.rar [点击查看]
上传用户:autowell
上传日期:2022-06-21
资源大小:16754k
文件大小:2k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit Unit2;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls;
- type
- TForm2 = class(TForm)
- GroupBox1: TGroupBox;
- Label1: TLabel;
- Label2: TLabel;
- Edit1: TEdit;
- Label3: TLabel;
- Edit2: TEdit;
- Button1: TButton;
- Button2: TButton;
- RadioButton1: TRadioButton;
- RadioButton2: TRadioButton;
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form2: TForm2;
- implementation
- uses unit1;
- {$R *.dfm}
- procedure TForm2.Button1Click(Sender: TObject);
- begin
- if (not RadioButton1.checked) and (not RadioButton2.Checked) then
- MessageDlg('请选择用户身份!',mtWarning,[mbOK],0); //必须选择用户身份
- if RadioButton1.checked then //用户身份为管理员
- if edit1.text='glmm' then
- begin
- showmessage('恭喜你成功登陆系统');
- MessageDlg('恭喜你成功登陆系统!',mtInformation,[mbOK],0);
- close;
- end
- else
- MessageDlg('密码错误,请重新输入!',mtError,[mbOK],0);
- If RadioButton2.checked then //用户身份为考生
- if Length(Edit2.text)<>8 then
- MessageDlg('重新输入准考号!',mtWarning,[mbOK],0)
- else
- begin
- showmessage('恭喜你成功登陆系统!进入考试');
- close;
- end;
- end;
- procedure TForm2.Button2Click(Sender: TObject);
- begin
- form1.close;
- form2.Close;
- end;
- end.