A WindowsIdentity currentUser = WindowsIdentity.GetCurrent(); foreach (IdentityReference grp in currentUser.Groups) { NTAccount grpAccount =
((NTAccount)grp.Translate(typeof(NTAccount))); isAuthorized = grpAccount.Value.Equals(
Environment.MachineName + @"\Clerk");
"A Composite Solution With Just One Click" - Certification Guaranteed 248 Microsoft 70-536 Exam
if (isAuthorized) break;
}
B WindowsPrincipal currentUser =
(WindowsPrincipal)Thread.CurrentPrincipal;
isAuthorized = currentUser.IsInRole(
Environment.MachineName);
C WindowsPrincipal currentUser =
(WindowsPrincipal)Thread.CurrentPrincipal;
isAuthorized = currentUser.IsInRole("Clerk");
D GenericPrincipal currentUser =
(GenericPrincipal) Thread.CurrentPrincipal;
isAuthorized = currentUser.IsInRole("Clerk");