asp.net - How to check user is in administrator group or not -


how user's group or user in admin group or not ?

i using .net framework 3.5 web application.

i user name follows:

   dim struser string = system.web.httpcontext.current.user.identity.name.toupper 

now, need check whether user in admin group or not ? or else, user's group.

please share me stuff helps me achieve this.

thank you.

var isadmin =((system.security.principal.windowsprincipal)this.httpcontext.user).isinrole(system.security.principal.windowsbuiltinrole.administrator) 

Comments

Popular posts from this blog

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -