YouarecreatinganASP.NETWebsite.ThesiteisconfiguredtouseMembershipandRolemanagementproviders.Youneedtocheckwhetherthecurrentlylogged-onuserisamemberofarolenamedAdministrators.Whichcodesegmentshouldyouuse?()A.boolisMember=Roles.GetUsersInRole("Administrator

题目

YouarecreatinganASP.NETWebsite.ThesiteisconfiguredtouseMembershipandRolemanagementproviders.Youneedtocheckwhetherthecurrentlylogged-onuserisamemberofarolenamedAdministrators.Whichcodesegmentshouldyouuse?()

A.boolisMember=Roles.GetUsersInRole("Administrators").Any()

B.boolisMember=Membership.ValidateUser(User.Identity.Name,"Administrators")

C.boolisMember=Roles.GetRolesForUser("Administrators").Any()

D.boolisMember=User.IsInRole("Administrators")


相似考题