D
dowms22
Unregistered / Unconfirmed
GUEST, unregistred user!
在服务器端定仪了登陆方法如下:
procedure Txcinfo.Logined(bAliasName, aPassword: OleVariant;
var aLogined: OleVariant);
var
sqlString: string;
begin
aLogined := True;
//用SQL语句来判断身份是否存在
sqlString := 'select * from tbluser where username=' + '''' + bAliasName + ''' and ';
sqlString := sqlString + ' password=' + '''' + aPassword + '''';
Q_General.Close;
Q_General.SQL.Clear;
Q_General.SQL.Add(sqlString);
try
Q_General.Open;
except
aLogined := False;
exit;
end;
if Q_General.RecordCount = 0 then
//查到记录为O,代表身份不存在
begin
aLogined := False;
exit;
end;
// aflag:=Q_General.FieldbyName('flag').asString;
end;
在客房端调用时出现如题错误,客户端程序如下:
var
vLogined: variant;
vAliasName, vPassword,vflag: string;
vLoginTime: variant;
begin
if edit1.Text ='' then
begin
showmessage('请输入用户名!');
abort;
end;
vAliasName := edit1.text;
vPassword := edit2.Text;
frminfoclient.SocketConnection1.AppServer.Logined(vAliasName, vPassword, vLogined);
if not vLogined then
begin
Application.MessageBox('用户名和密码不正确,请重新输入', '提示信息', mb_iconInformation + mb_defbutton1);
exit;
end
else
begin
//向全局记录变量CurrentParam赋值
CurrentParam.userAliasName := edit1.Text;
frminfoclient.SocketConnection1.AppServer.GetSysTime(vLoginTime);
CurrentParam.LoginTime := vLoginTime;
CurrentParam.UserFlag :=vflag;
end;
各位大侠,这是什么原因??
procedure Txcinfo.Logined(bAliasName, aPassword: OleVariant;
var aLogined: OleVariant);
var
sqlString: string;
begin
aLogined := True;
//用SQL语句来判断身份是否存在
sqlString := 'select * from tbluser where username=' + '''' + bAliasName + ''' and ';
sqlString := sqlString + ' password=' + '''' + aPassword + '''';
Q_General.Close;
Q_General.SQL.Clear;
Q_General.SQL.Add(sqlString);
try
Q_General.Open;
except
aLogined := False;
exit;
end;
if Q_General.RecordCount = 0 then
//查到记录为O,代表身份不存在
begin
aLogined := False;
exit;
end;
// aflag:=Q_General.FieldbyName('flag').asString;
end;
在客房端调用时出现如题错误,客户端程序如下:
var
vLogined: variant;
vAliasName, vPassword,vflag: string;
vLoginTime: variant;
begin
if edit1.Text ='' then
begin
showmessage('请输入用户名!');
abort;
end;
vAliasName := edit1.text;
vPassword := edit2.Text;
frminfoclient.SocketConnection1.AppServer.Logined(vAliasName, vPassword, vLogined);
if not vLogined then
begin
Application.MessageBox('用户名和密码不正确,请重新输入', '提示信息', mb_iconInformation + mb_defbutton1);
exit;
end
else
begin
//向全局记录变量CurrentParam赋值
CurrentParam.userAliasName := edit1.Text;
frminfoclient.SocketConnection1.AppServer.GetSysTime(vLoginTime);
CurrentParam.LoginTime := vLoginTime;
CurrentParam.UserFlag :=vflag;
end;
各位大侠,这是什么原因??