VGSecurityManagerLoadSecurity Method (String, VGAuthenticationMode, Boolean) |
Namespace: Novalys.VisualGuard.Security
public static VGAuthorizationState LoadSecurity( string name, VGAuthenticationMode mode, bool isAuthenticated )
Exception | Condition |
---|---|
NotSupportedException | the repository does not support the specified authentication mode. |
ArgumentNullException | name is null. |
ArgumentException | The name is longer than 64 characters The name is empty. |
VGConfigurationException | The configuration file is not valid
or A problem occurs during the connection to the repository.or The version of the repository or the version of the permissions is not supported by the application. |
VGAuthorizationState state = VGSecurityManager.LoadSecurity ("myUserName", VGAuthenticationMode.Database, true); if (state.IsFailed) { if (state.IsUserNotFound) { MessageBox.Show("Your are not declared in the security repository"); } elseif (state.IsUserNotAuthorized) { MessageBox.Show("Your are not authorized to log on to this application") } } else { Application.Run(new MDIForm()) }