ConnectionLogin Method (String, Options, String)
|
Run a Login on the Perforce Server
Namespace:
Perforce.P4
Assembly:
p4api.net (in p4api.net.dll) Version: 2024.1.261.8274
Syntax public Credential Login(
string password,
Options options,
string user
)
Public Function Login (
password As String,
options As Options,
user As String
) As Credential
public:
Credential^ Login(
String^ password,
Options^ options,
String^ user
)
member Login :
password : string *
options : Options *
user : string -> Credential
Parameters
- password
- Type: SystemString
User' password - options
- Type: Perforce.P4Options
Login options (see remarks in help file) - user
- Type: SystemString
Login as user
Return Value
Type:
CredentialSuccess/Failure
Remarks
p4 help login
login -- Log in to Perforce by obtaining a session ticket
p4 login [-a -p] [-h <host>] [user]
p4 login [-s]
p4 login [-r remote spec]
The login command enables a user to access Perforce until the session
expires or the user logs out.
When a user logs in to Perforce, they are prompted for a password
If they enter the correct password, they are issued a ticket. The
ticket expires when the default timeout value has been reached and
is valid only for the host machine where the 'login' command was
executed (see below for exception).
The ticket can be used anywhere that a password can be used.
Example: p4 -P <ticket value> changes -m1
The -a flag causes the server to issue a ticket that is valid on all
host machines.
The -h flag causes the server to issue a ticket that is valid on the
specified host (IP address). This flag is typically used together
with the -p flag to acquire a ticket that can be used on a different
machine.
The -p flag displays the ticket, but does not store it on the client
machine.
The -s flag displays the status of the current ticket (if there is
one).
Specifying a username as an argument to 'p4 login' requires 'super'
access, which is granted by 'p4 protect'. In this case, 'p4 login'
does not prompt for the password (you must already be logged in).
See Also