Login Method  
 

Login to the server.

Syntax

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

Parameters

UserName
A string that specifies the name of the user logging into the server. This argument is optional, and if it is omitted, the value of the UserName property will be used. If the UserName property has not been set, an anonymous user session is established.
Password
A string that specifies the password used to authenticate the user. This argument is optional, and if it is omitted, the value of the Password property will be used. If no user name has been specified, then an anonymous user session is established; in this case, the common convention that is used is that the password is specified as the current user's email address.
Account
A string that specifies the account name to be used when authenticating the user. This argument is optional, and if omitted, the value of the Account property will be used. An account name should only be specified if required by the server. Most UNIX and Windows based FTP servers do not require an account name.

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 identifies the user to the server. If the user name or password is invalid, an error will occur. By default, when a connection is established, the UserName, Password and Account properties are used to automatically log the user in to the server.

This method should only be used after calling the Logout method, enabling you to log in as another user during the same session. Not all servers will permit a client to change user credentials during the same session. In most cases, it is preferable to disconnect from the server and re-connect using the new credentials rather than using this method.

This method is not supported with secure connections using the SSH protocol.

See Also

Account Property, Password Property, UserName Property, Connect Method, Logout Method