procedure TDL.DL_loadClick(Sender: TObject);var
i : Integer;
User, Password : String;
begin
with DL.Create(self) do
try
i := GetEnvironmentVariable(PChar('REG_NAME'),PChar(User), 0);
if i>0 then
begin
SetLength(User,i);
GetEnvironmentVariable(PChar('REG_NAME'),PChar(User), i);
end;
i := GetEnvironmentVariable(PChar('PWD'),Pchar(PASSWORD), 0);
if i>0 then
begin
SetLength(PASSWORD,i);
GetEnvironmentVariable(PChar('PWD'),PChar(PASSWORD), i);
end;
if CompareStr(User, DL_name.text)=0
then if CompareStr(Password, DL_pwd.Text)=0
then
SYS_FORM.ShowModal
else
showmessage('用户名和密码不符,请重新登录');
DL_regClick(Sender);
except
application.Terminate;
end;
以上过程能够编译,但运行后出错,Project xxxx raised exception class Estackoverflow with message 'stackoverflow'.Process stopped. Use Step or Run to continue.
请各位高手指点一下,谢谢!!!!!!!!!!!!!
i : Integer;
User, Password : String;
begin
with DL.Create(self) do
try
i := GetEnvironmentVariable(PChar('REG_NAME'),PChar(User), 0);
if i>0 then
begin
SetLength(User,i);
GetEnvironmentVariable(PChar('REG_NAME'),PChar(User), i);
end;
i := GetEnvironmentVariable(PChar('PWD'),Pchar(PASSWORD), 0);
if i>0 then
begin
SetLength(PASSWORD,i);
GetEnvironmentVariable(PChar('PWD'),PChar(PASSWORD), i);
end;
if CompareStr(User, DL_name.text)=0
then if CompareStr(Password, DL_pwd.Text)=0
then
SYS_FORM.ShowModal
else
showmessage('用户名和密码不符,请重新登录');
DL_regClick(Sender);
except
application.Terminate;
end;
以上过程能够编译,但运行后出错,Project xxxx raised exception class Estackoverflow with message 'stackoverflow'.Process stopped. Use Step or Run to continue.
请各位高手指点一下,谢谢!!!!!!!!!!!!!
把这条去掉
这句去掉之后,能够回到登陆界面吗????
我再试诗,我觉得这里的指针变量i是不是没有中止????
谢谢!!!!