TAstaServerSocket.OnClientLogin
Applies to
TAstaServerSocket
Declaration
type TAstaLoginEvent = procedure(Sender:
TObject; UserName,
Password, AppName: string; var
Verified: Boolean) of object;
property OnClientLogin: TAstaLoginEvent;
Description
Assign code to this event handler if you wish to provide login routines using the AstaClientSocket's
AutoLoginDlg
property. If you wanted to compare an AstaClient's user name and password input against a list of valid
user names and passwords that you maintain, this is the place to do it. The TAstaClientSocket has a corresponding
OnLoginAttempt
event.
Note: The Verified parameter returns the results of the attempt to the client. If you verification attempt succeeds then set Verified to True, if it fails, set Verified to False.
The following code simply adds the user name, password and the application name to a memo on the server.
procedure
TForm1.AstaServerSocket1ClientLogin(Sender: TObject;
UserName, Password, AppName: string;
var Verified: Boolean);
begin
mLogin.Lines.Add('UserName: ' + UserName + ' Password: ' +
Password + ' Application Name: ' + AppName);
//Return a successful login attempt
Verified := True;
end;