Delphi7form3是登陆密码验证框,form是主界面,我想打开程序先进行密码验证,后进入主界面,如何修改?
unitUnit3;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,F...
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm3 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
CheckBox1: TCheckBox;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
uses Unit1;
const
Password:String='yangguoyan';
var
n: Integer= 3;
ShowPassword: boolean=False;
{$R *.dfm}
procedure TForm3.FormCreate(Sender: TObject);
begin
SetWindowLong(Edit1.Handle,GWL_STYLE, GetWindowLong(Edit1.Handle,GWL_STYLE)
or ES_RIGHT);
EDIT1.Invalidate;
end;
procedure TForm3.Button1Click(Sender: TObject);
begin
if( Edit1.Text= Password) then
MessageBox(handle,'恭喜您,密码正确!','恭喜',MB_OK)
Form1.show;
Form3.Visible=False;
else
begin
n:= n-1;
if(n<1) then
begin
MessageBox(handle,'抱歉,您错误次数太多,程序将自动关闭!','警告',MB_OK Or MB_ICONSTOP);
Close;
end
Else
begin
Label1.Caption:='密码错误,您还有'+IntToStr(n)+'次机会!';
Edit1.Text:='';
end;
end;
end;
procedure TForm3.CheckBox1Click(Sender: TObject);
begin
ShowPassword:= Not ShowPassword;
if (ShowPassword = True ) then
Edit1.PasswordChar:=#0
eLSE
Edit1.PasswordChar:='*';
end;
procedure TForm3.Button2Click(Sender: TObject);
begin
Close;
end;
end.
[Error] Unit3.pas(51): Missing operator or semicolon 展开
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm3 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
CheckBox1: TCheckBox;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
uses Unit1;
const
Password:String='yangguoyan';
var
n: Integer= 3;
ShowPassword: boolean=False;
{$R *.dfm}
procedure TForm3.FormCreate(Sender: TObject);
begin
SetWindowLong(Edit1.Handle,GWL_STYLE, GetWindowLong(Edit1.Handle,GWL_STYLE)
or ES_RIGHT);
EDIT1.Invalidate;
end;
procedure TForm3.Button1Click(Sender: TObject);
begin
if( Edit1.Text= Password) then
MessageBox(handle,'恭喜您,密码正确!','恭喜',MB_OK)
Form1.show;
Form3.Visible=False;
else
begin
n:= n-1;
if(n<1) then
begin
MessageBox(handle,'抱歉,您错误次数太多,程序将自动关闭!','警告',MB_OK Or MB_ICONSTOP);
Close;
end
Else
begin
Label1.Caption:='密码错误,您还有'+IntToStr(n)+'次机会!';
Edit1.Text:='';
end;
end;
end;
procedure TForm3.CheckBox1Click(Sender: TObject);
begin
ShowPassword:= Not ShowPassword;
if (ShowPassword = True ) then
Edit1.PasswordChar:=#0
eLSE
Edit1.PasswordChar:='*';
end;
procedure TForm3.Button2Click(Sender: TObject);
begin
Close;
end;
end.
[Error] Unit3.pas(51): Missing operator or semicolon 展开
1个回答
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询