AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
Thread.CurrentPrincipal = new WindowsPrincipal(WindowsIdentity.GetCurrent());
Some how I would need to use Thread.CurrentPrincipal. How would you set this up in the switch statement?
Sam HobbsPosted Aug 30, 2011, 2:41 PM
Also, depending on how many values that there are to compare to, it might be more efficient for you and the computer to use a collection such as a Dictionary.
VulpesPosted Aug 30, 2011, 4:29 PM
If you do use a switch statement (though, as Sam says, you can just as easily use multiple if statements), then you can switch on either of the two string properties. Although you won't find it in any books, switching on a bool property also works, though if/else is certainly easier to write in that case.