Login Method  
 

Authenticate the user and log them in to the current session.

Syntax

object.Login( [UserName], [Password] )

Parameters

UserName
An optional string argument which specifies the username which should be used to authenticate the client session. If this argument is omitted, the value of the UserName property will be used.
Password
An optional string argument which specifies the password which should be used to authenticate the client session. If this argument is omitted, the value of the Password property will be used.

Return Value

A value of zero is returned if the operation was successful, otherwise a non-zero error code is returned which indicates the cause of the failure.

Remarks

The Login method is specifically designed to work with most UNIX based servers, and may work with other servers that use a similar login process. The method works by scanning the data stream for a username prompt and then replying with the specified username. If that is successful, it will then scan for a password prompt and provide the specified password. If no recognized prompt is found, or if the server responds with an error indicating that the username or password is invalid, the method will fail.

If the Login method succeeds, the next call to the Read method by the client will return any welcome message to the user. This is typically followed by a command prompt where the user can enter commands to be executed on the server. The data sent by the server during the login process is discarded and not available when the function returns. If the client requires this information, use the Search method to automate the login process instead.

Because the Login method is designed for UNIX based systems, it may not work with servers running on other operating system platforms such as Windows or VMS. In this case, applications should use the Search method to search for the appropriate login prompts in the data stream.

See Also

Connect Method, Disconnect Method, Read Method, Search Method