How to

find out whether current user is anonymous

Published: 14. October 2011 | Updated: 26. October 2011
License: Microsoft Public License (MS-PL)
Categories: Windows » Authorization
Tags: Authorization C# Windows
Was this snippet helpful for you? YESYES / NONO

Import namespace

using System.Security.Principal;

Code

var identity = WindowsIdentity.GetCurrent();
bool isGuest = identity.IsAnonymous;
Send us feedback about this snippet »



Related Snippets: