User2.LoginName property

Gets the user's full credentials.

Namespace:  Microsoft.Office.Interop.InfoPath
Assembly:  Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.dll)

Syntax

'Declaration
ReadOnly Property LoginName As String
    Get
'Usage
Dim instance As User2
Dim value As String

value = instance.LoginName
string LoginName { get; }

Property value

Type: System.String
The user's credentials as domain\username.

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.

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)

See also

Reference

User2 interface

User2 members

Microsoft.Office.Interop.InfoPath namespace