Exemplo n.º 1
0
        private bool InitiateConnectionLite()
        {
            bool result = false;

            try
            {
                // Проверка Win 8/2008/2012
                Network.Connect(RDPClient.Host, RDPClient.Port);
                MCS.send_connection_request(null, false);

                // Успешная авторизация
                if (RDPClient.GoodAuth)
                {
                    result = true;
                }
            }
            catch { }
            finally
            {
                // Остановка
                Disconnect();
            }

            return(result);
        }
Exemplo n.º 2
0
        internal static void processRedirection(RdpPacket data, bool bStdRedirect)
        {
            if (!bStdRedirect)
            {
                data.getLittleEndian16();
            }
            data.getLittleEndian16();
            data.getLittleEndian16();
            RDPClient.sessionID = data.getLittleEndian32();
            int num = data.getLittleEndian32();

            if ((num & 1) != 0)
            {
                RDPClient.Host = data.ReadUnicodeString();
            }
            byte[] buffer = null;
            if ((num & 2) != 0)
            {
                int count = data.getLittleEndian32();
                buffer = new byte[count];
                data.Read(buffer, 0, count);
            }
            if ((num & 4) != 0)
            {
                RDPClient.Username = data.ReadUnicodeString();
            }
            if ((num & 8) != 0)
            {
                RDPClient.Domain = data.ReadUnicodeString();
            }
            if ((num & 0x10) != 0)
            {
                RDPClient.Password = data.ReadUnicodeString();
            }
            if ((num & 0x200) != 0)
            {
                RDPClient.Host = data.ReadUnicodeString();
            }
            if ((num & 0x100) != 0)
            {
                RDPClient.Host = data.ReadUnicodeString();
            }
            if (!string.IsNullOrEmpty(RDPClient.Domain))
            {
                RDPClient.DomainAndUsername = RDPClient.Domain + @"\" + RDPClient.Username;
            }
            else
            {
                RDPClient.DomainAndUsername = RDPClient.Username;
            }
            if ((num & 0x80) == 0)
            {
                Network.Close();
                Licence.Reset();
                Network.Connect(RDPClient.Host, RDPClient.Port);
                MCS.send_connection_request(buffer, false);
            }
        }
Exemplo n.º 3
0
        private bool InitiateConnectionFullXP()
        {
            try
            {
                // Проверка Win 8/2008/2012
                Network.Connect(RDPClient.Host, RDPClient.Port);
                MCS.send_connection_request(null, false);

                RDPClient.GoodAuth = false;

                // Запуск сессии
                Rdp.Start();
            }
            catch { }
            finally
            {
                // Остановка
                Disconnect();
            }

            return(RDPClient.GoodAuth);
        }