Run a Login on the Perforce Server
Namespace: Perforce.P4Assembly: p4api.net (in p4api.net.dll) Version: 2017.3.160.836 (2017.3.160.0836)
Syntax
C# |
---|
public Credential Login( string password, Options options, string user ) |
Visual Basic |
---|
Public Function Login ( _ password As String, _ options As Options, _ user As String _ ) As Credential |
Visual C++ |
---|
public: Credential^ Login( String^ password, Options^ options, String^ user ) |
Parameters
- password
- Type: System..::..String
User' password
- options
- Type: Perforce.P4..::..Options
Login options (see remarks in help file)
- user
- Type: System..::..String
Login as user
Return Value
Success/FailureRemarks
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).