Click or drag to resize

ConnectionLogin Method (String, Options)

Login to the Perforce Server

Namespace:  Perforce.P4
Assembly:  p4api.net (in p4api.net.dll) Version: 2023.2.255.3501
Syntax
public Credential Login(
	string password,
	Options options
)

Parameters

password
Type: SystemString
User' password
options
Type: Perforce.P4Options
Login options (see remarks in help file)

Return Value

Type: Credential
Success/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]

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