Ejemplo n.º 1
0
 private void RdpConnectionOnOnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
 {
     Application.Exit();
     Connected  = false;
     Connecting = false;
     Dispose();
 }
Ejemplo n.º 2
0
        private void RdpClient_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
        {
            HideRdpClient = true;

            DisconnectReason = GetDisconnectReason(e.discReason);
            Disconnected     = true;
        }
        private void RdpClient_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
        {
            Connected    = false;
            Reconnecting = false;

            DisconnectReason = GetDisconnectReason(e.discReason);
        }
Ejemplo n.º 4
0
        protected void AxMsRdpClient_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
        {
            var reason = DisconnectReason.ConnectionTerminated;

            // https://social.technet.microsoft.com/wiki/contents/articles/37870.rds-remote-desktop-client-disconnect-codes-and-reasons.aspx
            // https://msdn.microsoft.com/en-us/library/aa382170%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
            switch (e.discReason)
            {
            case Reason_ClientDisconnect:
            case Reason_ServerDisconnect:
                reason = DisconnectReason.ConnectionEnded;
                break;

            case Reason_DisconnectedByUser:
                reason = DisconnectReason.KickedOut;
                break;

            case Reason_ServerNotFound:
                reason = DisconnectReason.ServerNotFound;
                break;

            case Reason_TimedOut:
                reason = DisconnectReason.ConnectionTimedOut;
                break;
            }

            OnDisconnected?.Invoke(this, reason);
        }
Ejemplo n.º 5
0
 void rdpClient_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
 {
     m_logger.LogInfo("RDP: Disconnected");
     if (isConnecting = true)
     {
         SetStatus("Forcibly disconnected from Remote Desktop Host");
     }
 }
Ejemplo n.º 6
0
 private void remote1_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
 {
     if (zoom == false)
     {
         EventArgs ex = new EventArgs();
         pclose_Click(sender, ex);
     }
 }
Ejemplo n.º 7
0
        /// <summary>
        /// 远程桌面连接断开事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Rdp_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
        {
            var rdp    = (AxMSTSCLib.AxMsRdpClient9NotSafeForScripting)sender;
            var nodeId = rdp.Tag.ToString();
            var node   = (RDSDataNode)FindNode(nodeId, serverTree.Nodes[0]);

            node.ImageIndex         = 1;
            node.SelectedImageIndex = 1;
        }
Ejemplo n.º 8
0
        private void RDPClient_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
        {
            connected_screens--;
            button1.Text = "Connect";
            TreeNode helper = (TreeNode)RDPClient.Tag;

            helper.ImageIndex         = 5;
            helper.SelectedImageIndex = 6;
        }
Ejemplo n.º 9
0
        void rdpClient_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
        {
            Program.AssertOnEventThread();

            if (OnDisconnected != null)
            {
                OnDisconnected(this, null);
            }
        }
Ejemplo n.º 10
0
        private void RDPCl_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
        {
            connected_screens--;
            AxMSTSCLib.AxMsRdpClientNotSafeForScripting rc = (AxMSTSCLib.AxMsRdpClientNotSafeForScripting)sender;
            TreeNode helper = (TreeNode)rc.Tag;

            helper.ImageIndex         = 5;
            helper.SelectedImageIndex = 6;
        }
Ejemplo n.º 11
0
        private void axRDP_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
        {
            //codes https://social.technet.microsoft.com/wiki/contents/articles/37870.rds-remote-desktop-client-disconnect-codes-and-reasons.aspx
            if (e.discReason != 3)
            {
                LoginUpdateEvent?.Invoke(this, new LoginResultArgs(axRDP.Server, LoginResultArgs.LoginResultCode.Failed, e.discReason.ToString()));
            }

            this.Close();
        }
Ejemplo n.º 12
0
        private void axRdpClient_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
        {
            //this is not closed when form explicitly closed by user
            var r = e.discReason;

            if (r != 2)
            {
                MessageBox.Show($"RDPClient disconnected with reason code {r}.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            Application.Exit();
        }
Ejemplo n.º 13
0
 private void RDCClient_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
 {
     this.WindowState       = FormWindowState.Normal;
     StatusLabel.Text       = "Status: Disconnected from the remote connection";
     ConnectionsFLP.Visible = true;
     RDCPanel.Visible       = false;
     ConnectionsFLP.BringToFront();
     StopBtn.Enabled          = false;
     AddConnectionBtn.Enabled = true;
     FullScreenBtn.Enabled    = false;
 }
Ejemplo n.º 14
0
        void RdpClient_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e) {

            // Stop playing Media
            _mp.Stop();

            m_logger.LogInfo("RDP: Disconnected");
            if (isConnecting == true) {
                isConnecting = false;
            }

        }
Ejemplo n.º 15
0
        /// <summary>
        /// Event-Methode:
        /// Wenn die Verbindung getrennt wurde
        /// </summary>
        private void rdp_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
        {
            LOG.StoreRdpLogMessage("Rdp-ActiveX-Control: Disconnected from host '" + m_host + "'");
            DEBUG.ShowMessageInConsole("Rdp-ActiveX-Control: Disconnected from host '" + m_host + "' - Disconnect-Code: " + e.discReason.ToString());

            //Wenn m_isreconnecting false ist, dann dies ausführen
            if (!m_isreconnecting)
            {
                //Zwingt die TabPage, zu verschwinden
                base.Parent.Dispose();
            }
        }
Ejemplo n.º 16
0
        void rdpControl_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
        {
            //http://msdn.microsoft.com/en-us/library/windows/desktop/aa382170(v=vs.85).aspx

            _Session.TriggerCloseConnectionEvent();

            //Show Errormessage, if a not estimated Disconnection occures
            if (DisconnectEvents.EventDescription.ContainsKey(e.discReason) &&
                DisconnectEvents.EventDescription[e.discReason].IsEstimated == false)
            {
                TopText = String.Format("Disconnected from Host. ({0})\n{1}", e.discReason, DisconnectEvents.EventDescription[e.discReason].ErrorMessage);
            }
            else if (!DisconnectEvents.EventDescription.ContainsKey(e.discReason))
            {
                TopText = String.Format("Unknown Error ({0})", e.discReason);
            }

            switch (e.discReason)
            {
            case 516:
                // ReSharper disable once ObjectCreationAsStatement
                new ProtocolException(beRemoteExInfoPackage.MajorInformationPackage,
                                      String.Format(
                                          "The remote server could not be contacted. Maybe the ip address is invalid or the dns name not solveable ('{0}'. [disconnectReasonSocketConnectFailed 516 (0x204)]", _Session.GetSessionServer().GetRemoteIP()));
                break;

            default:
                Logger.Warning("[Session: " + _Session.GetSessionID() + "] RDP Ctrl received disconnect event! [mstscax-ctrl-evt-id: " + e.discReason + "]", EventId.CloseConnection);
                break;
            }

            try
            {
                //If the connection is established: disconnect
                if (Ax.rdpControl.Connected != 0)
                {
                    Ax.rdpControl.Disconnect();
                }

                Ax = null;
            }
            catch (Exception ex)
            {
                Logger.Log(LogEntryType.Verbose, "Exeption on Disconnecting RDP-Connection", ex);
            }


            //Close the Tab
            CloseTab();
        }
Ejemplo n.º 17
0
        void RdpClient_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
        {
            btnDoExtenderConnect.Enabled  = true;
            btnExtenderDisconnect.Enabled = false;

            // Stop playing Media
            _mp.Stop();

            m_logger.LogInfo("RDP: Disconnected");
            if (isConnecting == true)
            {
                SetStatus("Forcibly disconnected from Remote Desktop Host");
                isConnecting = false;
            }
        }
Ejemplo n.º 18
0
        void rdpClient_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
        {
            Status("Disconnected from " + this._sd.Server);

            btnConnect.Enabled    = true;
            btnDisconnect.Enabled = false;

            { // check connection status on output
                System.Diagnostics.Debug.WriteLine("OnDisconnected " + rdpClient.Connected);
            }

            if (Disconnected != null)
            {
                Disconnected(this, e, this._listIndex);
            }
        }
Ejemplo n.º 19
0
        /// <summary>
        /// 远程桌面连接断开事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Rdp_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
        {
            var rdp    = (AxMSTSCLib.AxMsRdpClient9NotSafeForScripting)sender;
            var nodeId = rdp.Tag.ToString();
            var node   = (RDSDataNode)FindNode(nodeId, serverTree.Nodes[0]);

            node.ImageIndex         = 1;
            node.SelectedImageIndex = 1;

            if (rdp.Parent != null)
            {
                string panelName = rdp.Parent.Name;
                rdp.Parent.Dispose();
                rdp.Parent = null;
                rdPanelDictionary.Remove(panelName);
            }
        }
Ejemplo n.º 20
0
 private void m_rdpview_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
 {
     Console.WriteLine("m_rdpview_OnDisconnected");
     Application.Exit();
 }
Ejemplo n.º 21
0
        private void rdp_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
        {
            string disconnectedReason = string.Empty;
            bool   showMessage        = false;

            switch (e.discReason)
            {
            case 0: disconnectedReason = "No information is available."; showMessage = true; break;

            case 1: disconnectedReason = "Local disconnection."; showMessage = true; break;

            case 2: disconnectedReason = "Remote disconnection by user."; showMessage = true; break;

            case 3: disconnectedReason = "Remote disconnection by server."; showMessage = true; break;

            case 260: disconnectedReason = "DNS name lookup failure"; showMessage = true; break;

            case 262: disconnectedReason = "Out of memory."; showMessage = true; break;

            case 264: disconnectedReason = "Connection timed out."; showMessage = true; break;

            case 516: disconnectedReason = "Winsock socket connect failure."; showMessage = true; break;

            case 518: disconnectedReason = "Out of memory."; showMessage = true; break;

            case 520: disconnectedReason = "Host not found."; showMessage = true; break;

            case 772: disconnectedReason = "Winsock send call failure."; showMessage = true; break;

            case 774: disconnectedReason = "Out of memory."; showMessage = true; break;

            case 776: disconnectedReason = "Invalid IP address specified."; showMessage = true; break;

            case 1028: disconnectedReason = "Winsock recv call failure."; showMessage = true; break;

            case 1030: disconnectedReason = "Invalid security data."; showMessage = true; break;

            case 1032: disconnectedReason = "Internal error."; showMessage = true; break;

            case 1286: disconnectedReason = "Invalid encryption method specified."; showMessage = true; break;

            case 1288: disconnectedReason = "DNS lookup failed."; showMessage = true; break;

            case 1540: disconnectedReason = "Failed to find the requested server, device, or host."; showMessage = true; break;

            case 1542: disconnectedReason = "Invalid server security data."; showMessage = true; break;

            case 1544: disconnectedReason = "Internal timer error."; showMessage = true; break;

            case 1796: disconnectedReason = "Timeout occurred."; showMessage = true; break;

            case 1798: disconnectedReason = "Failed to unpack server certificate."; showMessage = true; break;

            case 2052: disconnectedReason = "Bad IP address specified."; showMessage = true; break;

            case 2055: disconnectedReason = "Login failed."; showMessage = true; break;

            case 2056: disconnectedReason = "Internal security error."; showMessage = true; break;

            case 2308: disconnectedReason = "Socket closed."; showMessage = true; break;

            case 2310: disconnectedReason = "Internal security error."; showMessage = true; break;

            case 2312: disconnectedReason = "Licensing timeout."; showMessage = true; break;

            case 2566: disconnectedReason = "Internal security error."; showMessage = true; break;

            case 2567: disconnectedReason = "The specified user has no account. "; showMessage = true; break;

            case 2822: disconnectedReason = "Encryption error."; break;

            case 2823: disconnectedReason = "The account is disabled"; break;

            case 2825: disconnectedReason = "The remote computer requires Network Level Authentication. Enable NLA in connection options"; showMessage = true; break;

            case 3078: disconnectedReason = "Decryption error."; showMessage = true; break;

            case 3079: disconnectedReason = "The account is restricted"; break;

            case 3080: disconnectedReason = "Decrompression error."; showMessage = true; break;

            case 3335: disconnectedReason = "The account is locked out"; break;

            case 3591: disconnectedReason = "The account is expired"; break;

            case 3847: disconnectedReason = "The password is expired"; break;

            case 4615: disconnectedReason = "The user password must be changed before logging on for the first time."; break;

            case 5639: disconnectedReason = "The policy does not support delegation of credentials to the target server."; break;

            case 5895: disconnectedReason = "Delegation of credentials to the target server is not allowed unless mutual authentication has been achieved."; break;

            case 6151: disconnectedReason = "No authority could be contacted for authentication. The domain name of the authenticating party could be wrong, the domain could be unreachable, or there might have been a trust relationship failure."; break;

            case 6919: disconnectedReason = "The received certificate is expired."; break;

            case 7175: disconnectedReason = "An incorrect PIN was presented to the smart card."; break;

            case 8455: disconnectedReason = "The server authentication policy does not allow connection requests using saved credentials. The user must enter new credentials."; break;

            case 8711: disconnectedReason = "The smart card is blocked."; break;

            default: disconnectedReason = string.Format("Unrecognized error: code {0}", e.discReason); break;
            }

            if (showMessage == true)
            {
                MessageBox.Show(disconnectedReason);
                hasbeenconnected = false;
                this.Close();
            }
        }
Ejemplo n.º 22
0
 private void ClientControl_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
 {
     Close();
 }
Ejemplo n.º 23
0
        private void RdpConnectionOnOnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
        {
            var discReason = e.discReason;
            var discMsg    = "";

            switch (discReason) // https://social.technet.microsoft.com/wiki/contents/articles/37870.remote-desktop-client-troubleshooting-disconnect-codes-and-reasons.aspx
            {
            case 0: discMsg = "No error"; break;

            case 1: discMsg = "User-initiated client disconnect.";  break;

            case 2: discMsg = "User-initiated client logoff.";  break;

            case 3: discMsg = "Your Remote Desktop Services session has ended, possibly for one of the following reasons:  The administrator has ended the session. An error occurred while the connection was being established. A network problem occurred.  For help solving the problem, see \"Remote Desktop\" in Help and Support.";  break;

            case 260: discMsg = "Remote Desktop can't find the computer \". This might mean that \" does not belong to the specified network.  Verify the computer name and domain that you are trying to connect to.";  break;

            case 262: discMsg = "This computer can't connect to the remote computer.  Your computer does not have enough virtual memory available. Close your other programs, and then try connecting again. If the problem continues, contact your network administrator or technical support.";  break;

            case 264: discMsg = "This computer can't connect to the remote computer.  The two computers couldn't connect in the amount of time allotted. Try connecting again. If the problem continues, contact your network administrator or technical support.";  break;

            case 266: discMsg = "The smart card service is not running. Please start the smart card service and try again.";  break;

            case 516: discMsg = "Remote Desktop can't connect to the remote computer for one of these reasons:  1) Remote access to the server is not enabled 2) The remote computer is turned off 3) The remote computer is not available on the network  Make sure the remote computer is turned on and connected to the network, and that remote access is enabled.";  break;

            case 522: discMsg = "A smart card reader was not detected. Please attach a smart card reader and try again.";  break;

            case 772: discMsg = "This computer can't connect to the remote computer.  The connection was lost due to a network error. Try connecting again. If the problem continues, contact your network administrator or technical support.";  break;

            case 778: discMsg = "There is no card inserted in the smart card reader. Please insert your smart card and try again.";  break;

            case 1030: discMsg = "Because of a security error, the client could not connect to the remote computer. Verify that you are logged on to the network, and then try connecting again.";  break;

            case 1032: discMsg = "The specified computer name contains invalid characters. Please verify the name and try again.";  break;

            case 1034: discMsg = "An error has occurred in the smart card subsystem. Please contact your helpdesk about this error.";  break;

            case 1796: discMsg = "This computer can't connect to the remote computer.  Try connecting again. If the problem continues, contact the owner of the remote computer or your network administrator.";  break;

            case 1800: discMsg = "Your computer could not connect to another console session on the remote computer because you already have a console session in progress.";  break;

            case 2056: discMsg = "The remote computer disconnected the session because of an error in the licensing protocol. Please try connecting to the remote computer again or contact your server administrator.";  break;

            case 2308: discMsg = "Your Remote Desktop Services session has ended.  The connection to the remote computer was lost, possibly due to network connectivity problems. Try connecting to the remote computer again. If the problem continues, contact your network administrator or technical support.";  break;

            case 2311: discMsg = "The connection has been terminated because an unexpected server authentication certificate was received from the remote computer. Try connecting again. If the problem continues, contact the owner of the remote computer or your network administrator.";  break;

            case 2312: discMsg = "A licensing error occurred while the client was attempting to connect (Licensing timed out). Please try connecting to the remote computer again.";  break;

            case 2567: discMsg = "The specified username does not exist. Verify the username and try logging in again. If the problem continues, contact your system administrator or technical support.";  break;

            case 2820: discMsg = "This computer can't connect to the remote computer.  An error occurred that prevented the connection. Try connecting again. If the problem continues, contact the owner of the remote computer or your network administrator.";  break;

            case 2822: discMsg = "Because of an error in data encryption, this session will end. Please try connecting to the remote computer again.";  break;

            case 2823: discMsg = "The user account is currently disabled and cannot be used. For assistance, contact your system administrator or technical support.";  break;

            case 2825: discMsg = "The remote computer requires Network Level Authentication, which your computer does not support. For assistance, contact your system administrator or technical support.";  break;

            case 3079: discMsg = "A user account restriction (for example, a time-of-day restriction) is preventing you from logging on. For assistance, contact your system administrator or technical support.";  break;

            case 3080: discMsg = "The remote session was disconnected because of a decompression failure at the client side. Please try connecting to the remote computer again.";  break;

            case 3335: discMsg = "As a security precaution, the user account has been locked because there were too many logon attempts or password change attempts. Wait a while before trying again, or contact your system administrator or technical support.";  break;

            case 3337: discMsg = "The security policy of your computer requires you to type a password on the Windows Security dialog box. However, the remote computer you want to connect to cannot recognize credentials supplied using the Windows Security dialog box. For assistance, contact your system administrator or technical support.";  break;

            case 3590: discMsg = "The client can't connect because it doesn't support FIPS encryption level.  Please lower the server side required security level Policy, or contact your network administrator for assistance";  break;

            case 3591: discMsg = "This user account has expired. For assistance, contact your system administrator or technical support.";  break;

            case 3592: discMsg = "Failed to reconnect to your remote session. Please try to connect again.";  break;

            case 3593: discMsg = "The remote PC doesn't support Restricted Administration mode.";  break;

            case 3847: discMsg = "This user account's password has expired. The password must change in order to logon. Please update the password or contact your system administrator or technical support.";  break;

            case 3848: discMsg = "A connection will not be made because credentials may not be sent to the remote computer. For assistance, contact your system administrator.";  break;

            case 4103: discMsg = "The system administrator has restricted the times during which you may log in. Try logging in later. If the problem continues, contact your system administrator or technical support.";  break;

            case 4104: discMsg = "The remote session was disconnected because your computer is running low on video resources.  Close your other programs, and then try connecting again. If the problem continues, contact your network administrator or technical support.";  break;

            case 4359: discMsg = "The system administrator has limited the computers you can log on with. Try logging on at a different computer. If the problem continues, contact your system administrator or technical support.";  break;

            case 4615: discMsg = "You must change your password before logging on the first time. Please update your password or contact your system administrator or technical support.";  break;

            case 4871: discMsg = "The system administrator has restricted the types of logon (network or interactive) that you may use. For assistance, contact your system administrator or technical support.";  break;

            case 5127: discMsg = "The Kerberos sub-protocol User2User is required. For assistance, contact your system administrator or technical support.";  break;

            case 6919: discMsg = "Remote Desktop cannot connect to the remote computer because the authentication certificate received from the remote computer is expired or invalid.  In some cases, this error might also be caused by a large time discrepancy between the client and server computers.";  break;

            case 7431: discMsg = "Remote Desktop cannot verify the identity of the remote computer because there is a time or date difference between your computer and the remote computer. Make sure your computer's clock is set to the correct time, and then try connecting again. If the problem occurs again, contact your network administrator or the owner of the remote computer.";  break;

            case 8711: discMsg = "Your computer can't connect to the remote computer because your smart card is locked out. Contact your network administrator about unlocking your smart card or resetting your PIN.";  break;

            case 9479: discMsg = "Could not auto-reconnect to your applications,please re-launch your applications";  break;

            case 9732: discMsg = "Client and server versions do not match. Please upgrade your client software and then try connecting again.";  break;

            case 33554433: discMsg = "Failed to reconnect to the remote program. Please restart the remote program.";  break;

            case 33554434: discMsg = "The remote computer does not support RemoteApp. For assistance, contact your system administrator.";  break;

            case 50331649: discMsg = "Your computer can't connect to the remote computer because the username or password is not valid. Type a valid user name and password.";  break;

            case 50331650: discMsg = "Your computer can't connect to the remote computer because it can't verify the certificate revocation list. Contact your network administrator for assistance.";  break;

            case 50331651: discMsg = "Your computer can't connect to the remote computer due to one of the following reasons:  1) The requested Remote Desktop Gateway server address and the server SSL certificate subject name do not match. 2) The certificate is expired or revoked. 3) The certificate root authority does not trust the certificate.  Contact your network administrator for assistance.";  break;

            case 50331652: discMsg = "Your computer can't connect to the remote computer because the SSL certificate was revoked by the certification authority. Contact your network administrator for assistance.";  break;

            case 50331653: discMsg = "This computer can't verify the identity of the RD Gateway . It's not safe to connect to servers that can't be identified. Contact your network administrator for assistance.";  break;

            case 50331654: discMsg = "Your computer can't connect to the remote computer because the Remote Desktop Gateway server address requested and the certificate subject name do not match. Contact your network administrator for assistance.";  break;

            case 50331655: discMsg = "Your computer can't connect to the remote computer because the Remote Desktop Gateway server's certificate has expired or has been revoked. Contact your network administrator for assistance.";  break;

            case 50331656: discMsg = "Your computer can't connect to the remote computer because an error occurred on the remote computer that you want to connect to. Contact your network administrator for assistance.";  break;

            case 50331657: discMsg = "An error occurred while sending data to the Remote Desktop Gateway server. The server is temporarily unavailable or a network connection is down. Try again later, or contact your network administrator for assistance.";  break;

            case 50331658: discMsg = "An error occurred while receiving data from the Remote Desktop Gateway server. Either the server is temporarily unavailable or a network connection is down. Try again later, or contact your network administrator for assistance.";  break;

            case 50331659: discMsg = "Your computer can't connect to the remote computer because an alternate logon method is required. Contact your network administrator for assistance.";  break;

            case 50331660: discMsg = "Your computer can't connect to the remote computer because the Remote Desktop Gateway server address is unreachable or incorrect. Type a valid Remote Desktop Gateway server address.";  break;

            case 50331661: discMsg = "Your computer can't connect to the remote computer because the Remote Desktop Gateway server is temporarily unavailable. Try reconnecting later or contact your network administrator for assistance.";  break;

            case 50331662: discMsg = "Your computer can't connect to the remote computer because the Remote Desktop Services client component is missing or is an incorrect version. Verify that setup was completed successfully, and then try reconnecting later.";  break;

            case 50331663: discMsg = "Your computer can't connect to the remote computer because the Remote Desktop Gateway server is running low on server resources and is temporarily unavailable. Try reconnecting later or contact your network administrator for assistance.";  break;

            case 50331664: discMsg = "Your computer can't connect to the remote computer because an incorrect version of rpcrt4.dll has been detected. Verify that all components for Remote Desktop Gateway client were installed correctly.";  break;

            case 50331665: discMsg = "Your computer can't connect to the remote computer because no smart card service is installed. Install a smart card service and then try again, or contact your network administrator for assistance.";  break;

            case 50331666: discMsg = "Your computer can't stay connected to the remote computer because the smart card has been removed. Try again using a valid smart card, or contact your network administrator for assistance.";  break;

            case 50331667: discMsg = "Your computer can't connect to the remote computer because no smart card is available. Try again using a smart card.";  break;

            case 50331668: discMsg = "Your computer can't stay connected to the remote computer because the smart card has been removed. Reinsert the smart card and then try again.";  break;

            case 50331669: discMsg = "Your computer can't connect to the remote computer because the user name or password is not valid. Please type a valid user name and password.";  break;

            case 50331671: discMsg = "Your computer can't connect to the remote computer because a security package error occurred in the transport layer. Retry the connection or contact your network administrator for assistance.";  break;

            case 50331672: discMsg = "The Remote Desktop Gateway server has ended the connection. Try reconnecting later or contact your network administrator for assistance.";  break;

            case 50331673: discMsg = "The Remote Desktop Gateway server administrator has ended the connection. Try reconnecting later or contact your network administrator for assistance.";  break;

            case 50331674: discMsg = "Your computer can't connect to the remote computer due to one of the following reasons:   1) Your credentials (the combination of user name, domain, and password) were incorrect. 2) Your smart card was not recognized.";  break;

            case 50331675: discMsg = "Remote Desktop can't connect to the remote computer for one of these reasons:  1) Your user account is not listed in the RD Gateway's permission list 2) You might have specified the remote computer in NetBIOS format (for example, computer1), but the RD Gateway is expecting an FQDN or IP address format (for example, computer1.fabrikam.com or 157.60.0.1).  Contact your network administrator for assistance.";  break;

            case 50331676: discMsg = "Remote Desktop can't connect to the remote computer for one of these reasons:  1) Your user account is not authorized to access the RD Gateway 2) Your computer is not authorized to access the RD Gateway 3) You are using an incompatible authentication method (for example, the RD Gateway might be expecting a smart card but you provided a password)  Contact your network administrator for assistance.";  break;

            case 50331679: discMsg = "Your computer can't connect to the remote computer because your network administrator has restricted access to this RD Gateway server. Contact your network administrator for assistance.";  break;

            case 50331680: discMsg = "Your computer can't connect to the remote computer because the web proxy server requires authentication. To allow unauthenticated traffic to an RD Gateway server through your web proxy server, contact your network administrator.";  break;

            case 50331681: discMsg = "Your computer can't connect to the remote computer because your password has expired or you must change the password. Please change the password or contact your network administrator or technical support for assistance.";  break;

            case 50331682: discMsg = "Your computer can't connect to the remote computer because the Remote Desktop Gateway server reached its maximum allowed connections. Try reconnecting later or contact your network administrator for assistance.";  break;

            case 50331683: discMsg = "Your computer can't connect to the remote computer because the Remote Desktop Gateway server does not support the request. Contact your network administrator for assistance.";  break;

            case 50331684: discMsg = "Your computer can't connect to the remote computer because the client does not support one of the Remote Desktop Gateway's capabilities. Contact your network administrator for assistance.";  break;

            case 50331685: discMsg = "Your computer can't connect to the remote computer because the Remote Desktop Gateway server and this computer are incompatible. Contact your network administrator for assistance.";  break;

            case 50331686: discMsg = "Your computer can't connect to the remote computer because the credentials used are not valid. Insert a valid smart card and type a PIN or password, and then try connecting again.";  break;

            case 50331687: discMsg = "Your computer can't connect to the remote computer because your computer or device did not pass the Network Access Protection requirements set by your network administrator. Contact your network administrator for assistance.";  break;

            case 50331688: discMsg = "Your computer can't connect to the remote computer because no certificate was configured to use at the Remote Desktop Gateway server. Contact your network administrator for assistance.";  break;

            case 50331689: discMsg = "Your computer can't connect to the remote computer because the RD Gateway server that you are trying to connect to is not allowed by your computer administrator. If you are the administrator, add this Remote Desktop Gateway server name to the trusted Remote Desktop Gateway server list on your computer and then try connecting again.";  break;

            case 50331690: discMsg = "Your computer can't connect to the remote computer because your computer or device did not meet the Network Access Protection requirements set by your network administrator, for one of the following reasons:  1) The Remote Desktop Gateway server name and the server's public key certificate subject name do not match. 2) The certificate has expired or has been revoked. 3) The certificate root authority does not trust the certificate. 4) The certificate key extension does not support encryption. 5) Your computer cannot verify the certificate revocation list.  Contact your network administrator for assistance.";  break;

            case 50331691: discMsg = "Your computer can't connect to the remote computer because a user name and password are required to authenticate to the Remote Desktop Gateway server instead of smart card credentials.";  break;

            case 50331692: discMsg = "Your computer can't connect to the remote computer because smart card credentials are required to authenticate to the Remote Desktop Gateway server instead of a user name and password.";  break;

            case 50331693: discMsg = "Your computer can't connect to the remote computer because no smart card reader is detected. Connect a smart card reader and then try again, or contact your network administrator for assistance.";  break;

            case 50331695: discMsg = "Your computer can't connect to the remote computer because authentication to the firewall failed due to missing firewall credentials. To resolve the issue, go to the firewall website that your network administrator recommends, and then try the connection again, or contact your network administrator for assistance.";  break;

            case 50331696: discMsg = "Your computer can't connect to the remote computer because authentication to the firewall failed due to invalid firewall credentials. To resolve the issue, go to the firewall website that your network administrator recommends, and then try the connection again, or contact your network administrator for assistance.";  break;

            case 50331698: discMsg = "Your Remote Desktop Services session ended because the remote computer didn't receive any input from you.";  break;

            case 50331699: discMsg = "The connection has been disconnected because the session timeout limit was reached.";  break;

            case 50331700: discMsg = "Your computer can't connect to the remote computer because an invalid cookie was sent to the Remote Desktop Gateway server. Contact your network administrator for assistance.";  break;

            case 50331701: discMsg = "Your computer can't connect to the remote computer because the cookie was rejected by the Remote Desktop Gateway server. Contact your network administrator for assistance.";  break;

            case 50331703: discMsg = "Your computer can't connect to the remote computer because the Remote Desktop Gateway server is expecting an authentication method different from the one attempted. Contact your network administrator for assistance.";  break;

            case 50331704: discMsg = "The RD Gateway connection ended because periodic user authentication failed. Try reconnecting with a correct user name and password. If the reconnection fails, contact your network administrator for further assistance.";  break;

            case 50331705: discMsg = "The RD Gateway connection ended because periodic user authorization failed. Try reconnecting with a correct user name and password. If the reconnection fails, contact your network administrator for further assistance.";  break;

            case 50331707: discMsg = "Your computer can't connect to the remote computer because the Remote Desktop Gateway and the remote computer are unable to exchange policies. This could happen due to one of the following reasons:     1. The remote computer is not capable of exchanging policies with the Remote Desktop Gateway.     2. The remote computer's configuration does not permit a new connection.     3. The connection between the Remote Desktop Gateway and the remote computer ended.    Contact your network administrator for assistance.";  break;

            case 50331708: discMsg = "Your computer can't connect to the remote computer, possibly because the smart card is not valid, the smart card certificate was not found in the certificate store, or the Certificate Propagation service is not running. Contact your network administrator for assistance.";  break;

            case 50331709: discMsg = "To use this program or computer, first log on to the following website: ";  break;

            case 50331710: discMsg = "To use this program or computer, you must first log on to an authentication website. Contact your network administrator for assistance.";  break;

            case 50331711: discMsg = "Your session has ended. To continue using the program or computer, first log on to the following website:.";  break;

            case 50331712: discMsg = "Your session has ended. To continue using the program or computer, you must first log on to an authentication website. Contact your network administrator for assistance.";  break;

            case 50331713: discMsg = "The RD Gateway connection ended because periodic user authorization failed. Your computer or device didn't pass the Network Access Protection (NAP) requirements set by your network administrator. Contact your network administrator for assistance.";  break;

            case 50331714: discMsg = "Your computer can't connect to the remote computer because the size of the cookie exceeded the supported size. Contact your network administrator for assistance.";  break;

            case 50331716: discMsg = "Your computer can't connect to the remote computer using the specified forward proxy configuration. Contact your network administrator for assistance.";  break;

            case 50331717: discMsg = "This computer cannot connect to the remote resource because you do not have permission to this resource. Contact your network administrator for assistance.";  break;

            case 50331718: discMsg = "There are currently no resources available to connect to. Retry the connection or contact your network administrator.";  break;

            case 50331719: discMsg = "An error occurred while Remote Desktop Connection was accessing this resource. Retry the connection or contact your system administrator.";  break;

            case 50331721: discMsg = "Your Remote Desktop Client needs to be updated to the newest version. Contact your system administrator for help installing the update, and then try again.";  break;

            case 50331722: discMsg = "Your network configuration doesn't allow the necessary HTTPS ports. Contact your network administrator for help allowing those ports or disabling the web proxy, and then try connecting again.";  break;

            case 50331723: discMsg = "We're setting up more resources, and it might take a few minutes. Please try again later.";  break;

            case 50331724: discMsg = "The user name you entered does not match the user name used to subscribe to your applications. If you wish to sign in as a different user please choose Sign Out from the Home menu.";  break;

            case 50331725: discMsg = "Looks like there are too many users trying out the Azure RemoteApp service at the moment. Please wait a few minutes and then try again.";  break;

            case 50331726: discMsg = "Maximum user limit has been reached. Please contact your administrator for further assistance.";  break;

            case 50331727: discMsg = "Your trial period for Azure RemoteApp has expired. Ask your admin or tech support for help.";  break;

            case 50331728: discMsg = "You no longer have access to Azure RemoteApp. Ask your admin or tech support for help.";  break;

            case 4498: discMsg = "Extended Reason: The remote session was disconnected because of a decryption error at the server. Please try connecting to the remote computer again."; break;
            }
            Console.WriteLine("RdpConnectionOnOnDisconnected: " + discReason + " " + discMsg);
            Application.Exit();
            Connected  = false;
            Connecting = false;
            Dispose();
        }
Ejemplo n.º 24
0
        //*************************************************************************************************************
        private void rdpControl_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
        {
            loadingCircle1.Active  = false;
            loadingCircle1.Visible = false;
            buttonConnect.Visible  = true;

            switch (e.discReason)
            {
            case 2308:
                rdpControl.DisconnectedText = "Socket closed";
                break;

            case 3:
                //Remote disconnection by server. This is not an error code.
                ((KRBTabControl)(Parent.Parent)).TabPages.Remove((TabPageEx)Parent);
                rdpControl.Dispose();
                break;

            case 3080:
                rdpControl.DisconnectedText = "Decompression error.";
                break;

            case 264:
                rdpControl.DisconnectedText = "Connection timed out.";
                break;

            case 3078:
                rdpControl.DisconnectedText = "Decryption error.";
                break;

            case 260:
                rdpControl.DisconnectedText = "DNS name lookup failure.";
                break;

            case 1288:
                rdpControl.DisconnectedText = "DNS lookup failed.";
                break;

            case 2822:
                rdpControl.DisconnectedText = "Encryption error.";
                break;

            case 1540:
                rdpControl.DisconnectedText = "Windows Sockets gethostbyname call failed.";
                break;

            case 520:
                rdpControl.DisconnectedText = "Host not found error.";
                break;

            case 1032:
                rdpControl.DisconnectedText = "Internal error.";
                break;

            case 2310:
                rdpControl.DisconnectedText = "Internal security error.";
                break;

            case 2566:
                rdpControl.DisconnectedText = "Internal security error.";
                break;

            case 1286:
                rdpControl.DisconnectedText = "The encryption method specified is not valid.";
                break;

            case 2052:
                rdpControl.DisconnectedText = "Bad IP address specified.";
                break;

            case 1542:
                rdpControl.DisconnectedText = "Server security data is not valid.";
                break;

            case 1030:
                rdpControl.DisconnectedText = "Security data is not valid.";
                break;

            case 776:
                rdpControl.DisconnectedText = "The IP address specified is not valid.";
                break;

            case 2056:
                rdpControl.DisconnectedText = "License negotiation failed.";
                break;

            case 2312:
                rdpControl.DisconnectedText = "Licensing time-out.";
                break;

            case 1:
                //Local disconnection. This is not an error code.
                ((KRBTabControl)(Parent.Parent)).TabPages.Remove((TabPageEx)Parent);
                rdpControl.Dispose();
                break;

            case 0:
                rdpControl.DisconnectedText = "No information is available.";
                break;

            case 262:
                rdpControl.DisconnectedText = "Out of memory.";
                break;

            case 518:
                rdpControl.DisconnectedText = "Out of memory.";
                break;

            case 774:
                rdpControl.DisconnectedText = "Out of memory.";
                break;

            case 2:
                //Remote disconnection by user. This is not an error code.
                ((KRBTabControl)(Parent.Parent)).TabPages.Remove((TabPageEx)Parent);
                rdpControl.Dispose();
                break;

            case 1798:
                rdpControl.DisconnectedText = "Failed to unpack server certificate.";
                break;

            case 516:
                rdpControl.DisconnectedText = "Windows Sockets connect failed.";
                break;

            case 1028:
                rdpControl.DisconnectedText = "Windows Sockets recv call failed.";
                break;

            case 1796:
                rdpControl.DisconnectedText = "Time-out occurred.";
                break;

            case 1544:
                rdpControl.DisconnectedText = "Internal timer error.";
                break;

            case 772:
                rdpControl.DisconnectedText = "Windows Sockets send call failed.";
                break;

            case 2823:
                rdpControl.DisconnectedText = "The account is disabled.";
                break;

            case 3591:
                rdpControl.DisconnectedText = "The account is expired.";
                break;

            case 3335:
                rdpControl.DisconnectedText = "The account is locked out.";
                break;

            case 3079:
                rdpControl.DisconnectedText = "The account is restricted.";
                break;

            case 6919:
                rdpControl.DisconnectedText = "The received certificate is expired.";
                break;

            case 5639:
                rdpControl.DisconnectedText = "The policy does not support delegation of credentials to the target server.";
                break;

            case 8455:
                rdpControl.DisconnectedText = "The server authentication policy does not allow connection requests using saved credentials. The user must enter new credentials.";
                break;

            case 2055:
                rdpControl.DisconnectedText = "Login failed.";
                break;

            case 6151:
                rdpControl.DisconnectedText = "No authority could be contacted for authentication. The domain name of the authenticating party could be wrong, the domain could be unreachable, or there might have been a trust relationship failure.";
                break;

            case 2567:
                rdpControl.DisconnectedText = "The specified user has no account.";
                break;

            case 3847:
                rdpControl.DisconnectedText = "The password is expired.";
                break;

            case 4615:
                rdpControl.DisconnectedText = "The user password must be changed before logging on for the first time.";
                break;

            case 5895:
                rdpControl.DisconnectedText = "Delegation of credentials to the target server is not allowed unless mutual authentication has been achieved.";
                break;

            case 8711:
                rdpControl.DisconnectedText = "The smart card is blocked.";
                break;

            case 7175:
                rdpControl.DisconnectedText = "An incorrect PIN was presented to the smart card.";
                break;

            case 2825:
                rdpControl.DisconnectedText = "The remote computer requires Network Level Authentication, which your computer does not support. For assistance, contact your system administrator or technical support.";
                break;
            }
        }
Ejemplo n.º 25
0
 void rdpClient_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
 {
     rdpClient.Dispose();
     Dispose();
 }
 void rdpConnection_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
 {
     OnDisconnected(null);
 }
Ejemplo n.º 27
0
 private void mstsc_Disconnect(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
 {
     //MessageBox.Show($"Communication with {target} has been lost", "Disconnected", MessageBoxButtons.OK, MessageBoxIcon.Information);
     Application.Exit();
 }
 void clientWin_Disconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e, int ListIndex)
 {
     lvServerLists.Items[ListIndex].ImageIndex = 1;
     tabMDIChild.SelectedTab.ImageIndex        = 1;
 }
 void rdpc_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
 {
     ((Client.frmMain) this.FindForm()).DisconnectConnection(this.Text);
     ((TabControl)this.Parent).TabPages.Remove(this);
 }
Ejemplo n.º 30
0
 private void rdpConnection_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent e)
 {
     SetConnected(1, false);
 }