Window's Username and Domain helpers.
7
fracturedpsyche
Three little functions to return the Windows Identity, The Envoronment Identoty and the Environment Domain.
Public Shared Function GetCurrentWindowsIdentity() As String
Try
Return System.Security.Principal.WindowsIdentity.GetCurrent.Name
Catch ex As Exception
Return String.Empty
End Try
End Function
Public Shared Function GetCurrentEnvironmentIdentity() As String
Try
Return System.Environment.UserDomainName + "\" + System.Environment.UserName
Catch ex As Exception
Return String.Empty
End Try
End Function
Public Shared Function GetCurrentEnvironmentDomain() As String
Try
Return System.Environment.UserDomainName
Catch ex As Exception
Return String.Empty
End Try
End Function
Comments
Sun. Nov. 12th, 2006 11:58 PM
jbplou
jbplou





