1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
Public Function CurrentIdentity() As String
'Die Windows-Identität des aktuell angemeldeten Anwenders ermitteln.
Dim Identity As Security.Principal.WindowsIdentity
Dim str As New System.Text.StringBuilder
Identity = Security.Principal.WindowsIdentity.GetCurrent()
'und nun die der Identität zugehörigen Informationen darstellen.
str.AppendLine("Authentifiziert: " & vbTab & vbTab & Identity.IsAuthenticated)
str.AppendLine("Anonym: " & vbTab & vbTab & vbTab & Identity.IsAnonymous)
str.AppendLine("Gast: " & vbTab & vbTab & vbTab & Identity.IsGuest)
str.AppendLine("System: " & vbTab & vbTab & vbTab & Identity.IsSystem)
str.AppendLine("Authentifizierungstyp: " & vbTab & Identity.AuthenticationType)
str.AppendLine("Benutzername: " & vbTab & vbTab & Identity.Name)
str.AppendLine("Token: " & vbTab & vbTab & vbTab & Identity.Token.ToString())
Return (str.ToString)
End Function
|