예제 #1
0
            public static string ToDisconnectMessage(AxMsRdpClient7NotSafeForScripting client, int reason)
            {
                switch (reason)
                {
                case 1:
                case 2:
                case 3:
                    // These are normal disconnects and not considered errors.
                    return(String.Empty);

                default:
                    return(client.GetErrorDescription((uint)reason, (uint)client.ExtendedDisconnectReason));
                }
            }
        private void RDPEvent_OnDisconnected(object sender, IMsTscAxEvents_OnDisconnectedEvent e)
        {
            const int UI_ERR_NORMAL_DISCONNECT = 0xb08;

            if (e.discReason != UI_ERR_NORMAL_DISCONNECT)
            {
                string reason = RDP_Client.GetErrorDescription((uint)e.discReason, (uint)RDP_Client.ExtendedDisconnectReason);
                Event_Disconnected(this, e.discReason + Constants.vbCrLf + reason);
            }

            if (Settings.Default.ReconnectOnDisconnect)
            {
                ReconnectGroup        = new ReconnectGroup();
                ReconnectGroup.Left   = (Control.Width / 2) - (ReconnectGroup.Width / 2);
                ReconnectGroup.Top    = (Control.Height / 2) - (ReconnectGroup.Height / 2);
                ReconnectGroup.Parent = Control;
                ReconnectGroup.Show();
                tmrReconnect.Enabled = true;
            }
            else
            {
                Close();
            }
        }
예제 #3
0
            public static string ToDisconnectMessage(AxMsRdpClient7NotSafeForScripting client, int reason)
            {
                switch (reason)
                {
                    case 1:
                    case 2:
                    case 3:
                        // These are normal disconnects and not considered errors.
                        return String.Empty;

                    default:
                        return client.GetErrorDescription((uint)reason, (uint)client.ExtendedDisconnectReason);
                }
            }