This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ESRI.ArcGIS.Snippets > Snippets > Statements - Get DomainNameUserName Snippet (ArcObjects .NET 10.4 SDK) |
Obtain the DomainNameUserName of the currently logged in user.
//<-- Snippet Start --> // DESCRIPTION: // Obtain the DomainName_UserName of the currently logged in user. System.Security.Principal.WindowsIdentity windowsIdentity=System.Security.Principal.WindowsIdentity.GetCurrent(); System.String windowsLoginName=windowsIdentity.Name; //<-- Snippet End -->
'<-- Snippet Start --> ' DESCRIPTION: ' Obtain the DomainNameUserName of the currently logged in user. Dim windowsIdentity As System.Security.Principal.WindowsIdentity=System.Security.Principal.WindowsIdentity.GetCurrent Dim windowsLoginName As System.String=windowsIdentity.Name '<-- Snippet End -->