使用了ADOCONNECTION把?
将他的PROMPT设置成FALSE就可以了
将他的PROMPT设置成FALSE就可以了
解决方案 »
- 急!!!!使用WebBrowser控件时发现以下属性不存在,怎么办?
- strtodatetime时间字符串转换为TDateTime的问题
- Listview自画添加编辑框问题,有点小难度。
- 我用OLE开发的程序要发布了!要注意些什么?
- 在reportbuilder中怎样用代码实现加载模板(*.rtm),
- 怎样将Extended类型强制转换成Integer类型?
- 有无好的DELPHI的书籍的下载网址呢
- delphi2009中intraweb 哪个控件是可以让你选择日期和时间的?
- 再问一次: 如何通过程序判断在本机或数据库服务器(另一台机器)是否已经安装了MS SQL SERVER???
- 请教如何访问远程数据库?
- 学校的课程安排算法该什么编,该考虑些什么?
- 关于用delphi制作报表打印程序的问题.
begin
messagebox(application.Handle ,'hello','hello',2);
end;
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {Form2};{$R *.RES}begin
Application.Initialize;
form2:=Tform2.create(application);
form2.showmodal;
if form2.edit2.text<>'' then
application.Terminate
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
//老大,给分
form2是一个密码窗体,对不对?
对,就这意思。
Forms,
Main in 'Main.pas' {Form1};{$R *.res}begin
Application.Initialize;
application.ShowMainForm:=false;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
////////////////////
//main.pas
/////////////
procedure TForm1.FormCreate(Sender: TObject);
var
pas:string;
begin
if inputquery(application.Title,'Please Input Password:',pas) then
begin
if 'your password'<>pas then
begin
application.Terminate;
end
else
begin
application.ShowMainForm:=true;
end;
end
else
begin
application.Terminate;
end;
end;
窗体建立的顺序为FORM1、2、3……把LOGINFORM窗体从你的AUTO-CREATE FORMS中移至AVAILABLE FOMS(在PROJECT OPTIONS中设置)。在工程文件中修改:
原文件:
program Project1;uses
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {Form2};{$R *.res}begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm2, Form2);
Application.Run;
end.修改后:begin
LOGINFORM:=TLOGINFORM。CREATE(APPLIACTION);
loginform.showmodal;
if loginform.modalresult = 1 then
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm2, Form2);
Application.Run;
end;
end.
在LOGINFORM中处理密码验证: IF 正确 THEN
modalresult :=mrok
else
application.terminate;
end;同时还要初始化验证失败次数。Password Dialog ???
通常你要从数据库中取记录验证的。LOGINFORM要联接数据库的。
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {Form2};
这不对吧!应该是在Form1中的uses 加上 unit2;应该是在Form2中的uses 加上 unit1;
TO
vickly(Delphi新手)
如果用我的去做的话,下边的都不要;
uses
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {Form2};
这不对吧! 应该是在Form1中的uses 加上 unit2;应该是在Form2中的uses 加上 unit1;
application.Terminate;
是什么意思?
你看看在线帮助丫.
多看看帮助!
用InputQuery不能让输入框显示******,我输入的是密码啊!怎么办呢?
uses
forms,dialogs,controls,
mainFotm in 'MainForm.pas';
{$R *.RES}
var
Password: String;
begin
if InputQuery('Password', 'Enter your password', Password) the
if Password ='d5dg' then
begin
//其他操作
Application.createForm(TMainForm,MainForm);
Application.run;
end
else
MessageDlg('incorrect password, terminating program', mtError,[mbok],0);
end.
begin
Form2:=TForm2.Create(Application);
Form2.ShowModal;
if Form2.str='1' then
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end;
end.
具体处理密码的验证则放在Form2中处理
第一步:
program Project1; uses
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {Form2}; {$R *.RES} begin
Application.Initialize;
form2:=Tform2.create(application);
form2.showmodal;
if form2.v=false then
application.Terminate
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
Unit Unit2//form2
interface
...
...
var
form2:Tform2;
v:boolean;
....
procedure form2.formcreate(sender:Tobject);
begin
v:=false;
end;
procedure form2.button1click(sender:Tobject);
begin
query1.close;
query1.sql.clear;
query1.sql.add('select user,pas from T_mm')//用户信息从库里取,例子;
if query1.locate('user',edit1.text) then
if edit2.text=query1.field.asstring('pas').asstring;
then v:=true else
v:=false;
end;//当用户信息输入的不对时,v:=false;可以再program里进行判断
大哥,我给你说
form2是用来读取用户输入的对不对,如果不对的话,应用程序结束;
如果用户输入的对的话,则可以进去;
就是上边的;