unit11.pas
来自「学生管理系统(delphi7.0+sql2000) 对学生基本信息,学生成绩,」· PAS 代码 · 共 107 行
PAS
107 行
unit Unit11;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls;
type
TForm11 = class(TForm)
Panel1: TPanel;
Label1: TLabel;
Edit1: TEdit;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
Label2: TLabel;
ComboBox1: TComboBox;
procedure FormCreate(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form11: TForm11;
entertime:integer;
implementation
{$R *.dfm}
procedure TForm11.FormCreate(Sender: TObject);
begin
entertime:=0;
end;
procedure TForm11.BitBtn1Click(Sender: TObject);
var
pwfile1:textfile;
password1:string;
pwfile2:textfile;
password2:string;
begin
if ComboBox1.text='教师' then
begin
assignfile(pwfile1,'教师登录密码.txt');
reset(pwfile1);
readln(pwfile1,password1);
closefile(pwfile1);
inc(entertime);
if edit1.text=Password1 then
close
else
begin
label1.Caption:='密码输入错误,请重新输入:';
if entertime>=3 then
begin
messagebox(handle,'输入密码错误超过三次,程序退出!','信息',MB_ok);
close;
application.terminate;
end else
begin
edit1.Text:='';
edit1.SetFocus;
end;
end;
end
else
begin
assignfile(pwfile2,'学生登录密码.txt');
reset(pwfile2);
readln(pwfile2,password2);
closefile(pwfile2);
inc(entertime);
if edit1.text=Password2 then
close
else
begin
label1.Caption:='密码输入错误,请重新输入:';
if entertime>=3 then
begin
messagebox(handle,'输入密码错误超过三次,程序退出!','信息',MB_ok);
close;
application.terminate;
end else
begin
edit1.Text:='';
edit1.SetFocus;
end;
end;
end;
end;
procedure TForm11.BitBtn2Click(Sender: TObject);
begin
close;
application.terminate;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?