c# check if the user member of a group?

前端 未结 3 700
萌比男神i
萌比男神i 2020-12-09 18:17

I have a code that I use to check if the user is member of the AD, worked perfectly,

now I want to add the possibility to check if the user also a member of a group!

3条回答
  •  温柔的废话
    2020-12-09 18:56

    In ASP.Net you will use Page.User.IsInRole("RoleName") or in Windows you can use System.Threading.Thread.CurrentPrincipal.IsInRole("RoleName")

提交回复
热议问题