ClientApi::SetPassword( const StrPtr * )
Sets the password to be used for this connection.
Virtual? |
No |
Class |
Arguments |
||
|
the new password value |
Returns |
Notes
SetPassword()
does
not permanently change the P4PASSWD
value in the
environment, nor does it in any way change the password that has been set
on the server. The new setting applies only to authentication attempts
for commands executed by calling this ClientApi
object’s Run()
method.
Example
The following trivial example demonstrates how to hard-code a password into an application without making it (immediately) user-visible.
ClientApi client; ClientUser ui; StrBuf sb; sb = "p455w04d"; client.SetPassword( &sb ); client.SetArgv( argc - 2, argv + 2 ); client.Run( argv[1], &ui );