User2.UserName Property

Definition

Gets only the user's username.

public:
 property System::String ^ UserName { System::String ^ get(); };
public string UserName { get; }
member this.UserName : string
Public ReadOnly Property UserName As String

Property Value

The user's username.

Examples

In the following example, the UserName property is used to display the current user's login credentials.

User2 thisUser = thisApplication.User;
thisXDocument.UI.Alert(thisUser.UserName);
Dim thisUser As User2  = thisApplication.User
thisXDocument.UI.Alert(thisUser.UserName)

Remarks

Calling the UserName property is equivalent to calling System.Environment.UserName.

Applies to