User identity is a common means of controlling access to a business application or limiting the options available within that application. The .NET Framework classes under the namespace System.Security.Principal are provided to assist in making such role-based security determinations.
*firstly you must add this dll :
System.Security.Principal; System.Security.Policy;
then:
The Framework provides a WindowsIdentity class that represents an authenticated Windows user and a WindowsPrincipal class that encapsulates the WindowsIdentity and information about the user's role memberships. These objects representing the current user are accessible in one of two ways: using a static property on the Thread object or a static method on the WindowsIdentity object.
you can see example of windows identity and windows principal ;
namespace Example if (kimlik.IsAnonymous) kimlik = WindowsIdentity.GetCurrent(); } |
Hiç yorum yok:
Yorum Gönder