Exemple #1
0
        private void client_OnLogonError(object sender, IMsTscAxEvents_OnLogonErrorEvent e)
        {
            int errorCode = e.lError;

            string message = RdpClientErrorMessages.ToLogonMessage(errorCode);
            string finalMsg = string.Format("There was a logon error returned from the RDP connection.\nLogon code: {0}\nLogon description: {1}", errorCode, message);

            if (errorCode != -2)
                Log.Error(finalMsg);
            else
                Log.Debug(finalMsg);
        }
 private void client_OnLogonError(object sender, IMsTscAxEvents_OnLogonErrorEvent e)
 {
     int errorCode = e.lError;
     string message = RdpClientErrorMessages.ToLogonMessage(errorCode);
     string finalMsg = string.Format("There was a logon error returned from the RDP Connection, details:\n\nLogon Code:{0}\n\nLogon Description:{1}", errorCode, message);
     Logging.Error(finalMsg);
 }
Exemple #3
0
        private void client_OnLogonError(object sender, IMsTscAxEvents_OnLogonErrorEvent e)
        {
            failCode = e.lError;
            failInfo.Append("Logon error: ");

            switch (e.lError)
            {
                case -5:
                    failInfo.AppendLine("Winlogon is displaying the Session Contention dialog box.");
                    break;
                case -2:
                    failInfo.AppendLine("Winlogon is continuing with the logon process.");
                    break;
                case -3:
                    failInfo.AppendLine("Winlogon is ending silently.");
                    break;
                case -6:
                    failInfo.AppendLine("Winlogon is displaying the No Permissions dialog box.");
                    break;
                case -7:
                    failInfo.AppendLine("Winlogon is displaying the Disconnect Refused dialog box.");
                    break;
                case -4:
                    failInfo.AppendLine("Winlogon is displaying the Reconnect dialog box.");
                    break;
                case -1:
                    failInfo.AppendLine("The user was denied access.");
                    break;
                case 0:
                    failInfo.AppendLine("The logon failed because the logon credentials are not valid.");
                    break;
                case 2:
                    failInfo.AppendLine("Another logon or post-logon error occurred. The Remote Desktop client displays a logon screen to the user.");
                    break;
                case 1:
                    failInfo.AppendLine("The password is expired. The user must update their password to continue logging on.");
                    break;
                case 3:
                    failInfo.AppendLine("The Remote Desktop client displays a dialog box that contains important information for the user.");
                    break;
                case -1073741714:
                    failInfo.AppendLine("The user name and authentication information are valid, but authentication was blocked due to restrictions on the user account, such as time-of-day restrictions.");
                    break;
                case -1073741715:
                    failInfo.AppendLine("The attempted logon is not valid. This is due to either an incorrect user name or incorrect authentication information.");
                    break;
                case -1073741276:
                    failInfo.AppendLine("The password is expired. The user must update their password to continue logging on.");
                    break;
                default:
                    failInfo.AppendLine("An unknown error.");
                    break;
            }

            if (failCode == 3)
            {
                RaiseFormActionRequired(FormActionEventArgs.FormActionType.SendEnter);
            }
            else
            {
                if (failCode != -2)
                {
                    result = CheckStatusEnum.NotAuthentificated;
                    RaiseFormActionRequired(FormActionEventArgs.FormActionType.CaptureScreen);
                    //client.Disconnect();
                }
            }
        }