User2.LoginName Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the user's full credentials.
public:
property System::String ^ LoginName { System::String ^ get(); };
public string LoginName { get; }
member this.LoginName : string
Public ReadOnly Property LoginName As String
Property Value
The user's credentials as domain\username.
Examples
In the following example, the LoginName property is used to display the current user's login credentials.
User2 thisUser = thisApplication.User;
thisXDocument.UI.Alert(thisUser.LoginName);
Dim thisUser As User2 = thisApplication.User
thisXDocument.UI.Alert(thisUser.LoginName)
Remarks
The LoginName property returns a user's credentials as domain\username. If the user's account does not belong to a domain, the property returns only username.
This is equivalent to calling System.Environment.UserDomainName+"\\"+System.Environment.UserName.