NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

WindowsPrincipal.Identity

Exposes the WindowIdentity object of the user represented by the WindowsPrincipal object.

[Visual Basic]
Overridable Public ReadOnly Property Identity As IIdentity
[C#]
public IIdentity Identity {virtual get;}
[C++]
public: __property virtual IIdentity* get_Identity();
[JScript]
public function get Identity() : IIdentity;

Example [C#]

The following example retrieves the name of the user using the Identity property of the WindowsPrincipal object.

[C#]

WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
String username = wp.Identity.Name;

See Also

WindowsPrincipal Class | WindowsPrincipal Members | System.Security.Principal Namespace