Exemplo n.º 1
0
        /// <summary>
        /// Create a payload for start RDP connection command
        /// </summary>
        /// <param name="payloadType">Type of payload: Content of .rdp file or Parameter structure</param>
        /// <param name="localAddress">Local address</param>
        /// <param name="RDPPort">Port test suite listening</param>
        /// <param name="DirectApproach">true for 'Direct', false for 'Negotiate'</param>
        /// <param name="fullScreen">true for full screen, otherwise false</param>
        /// <returns>Return encoded binary of the payload</returns>
        private byte[] CreateRDPConncectPayload(RDP_Connect_Payload_Type payloadType, string localAddress, uint RDPPort, bool DirectApproach, bool fullScreen)
        {
            RDP_Connection_Payload payLoad = new RDP_Connection_Payload();

            payLoad.type = payloadType;

            if (payloadType == RDP_Connect_Payload_Type.RDP_FILE)
            {
                payLoad.rdpFileConfig = GenerateRDPFileString(localAddress, RDPPort, DirectApproach, fullScreen);
            }
            else
            {
                payLoad.configureParameters = GenerateRDPConnectionConfigParameters(localAddress, RDPPort, DirectApproach, fullScreen);
            }

            return(payLoad.Encode());
        }
        /// <summary>
        /// Create a payload for start RDP connection command
        /// </summary>
        /// <param name="payloadType">Type of payload: Content of .rdp file or Parameter structure</param>
        /// <param name="localAddress">Local address</param>
        /// <param name="RDPPort">Port test suite listening</param>
        /// <param name="DirectApproach">true for 'Direct', false for 'Negotiate'</param>
        /// <param name="fullScreen">true for full screen, otherwise false</param>
        /// <returns>Return encoded binary of the payload</returns>
        private byte[] CreateRDPConncectPayload(RDP_Connect_Payload_Type payloadType, string localAddress, uint RDPPort, bool DirectApproach, bool fullScreen)
        {
            RDP_Connection_Payload payLoad = new RDP_Connection_Payload();
            payLoad.type = payloadType;

            if (payloadType == RDP_Connect_Payload_Type.RDP_FILE)
            {
                payLoad.rdpFileConfig = GenerateRDPFileString(localAddress, RDPPort, DirectApproach, fullScreen);
            }
            else
            {
                payLoad.configureParameters = GenerateRDPConnectionConfigParameters(localAddress, RDPPort, DirectApproach, fullScreen);
            }

            return payLoad.Encode();
        }