Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
You can use the My.User object to get information about the current user. This example shows how to use the My.User.IsInRole method to determine if the user is a member of a particular group.
Example
This example uses the My.User.IsInRole method to determine if the user is an administrator before accessing a resource.
If My.User.IsInRole(
ApplicationServices.BuiltInRole.Administrator) Then
' Insert code to access a resource here.
End If
See Also
Tasks
How to: Determine the User's Domain (Visual Basic)
Walkthrough: Implementing Custom Authentication and Authorization (Visual Basic)