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

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -