Exemple #1
0
        public NASA_PACKET_INFO GetAsync(String QueryString)
        {
            SecurityProtocolType lastSecureProtocol = ServicePointManager.SecurityProtocol;

            ServicePointManager.SecurityProtocol = SecureProtocolType;
            using (Ajax NetasyncAjax = new Ajax(HttpAddr, Encoding.Unicode, SecureCookieContainer, AjaxType.AjaxGET))
            {
                NASA_PACKET_INFO packetInfo = new NASA_PACKET_INFO();
                packetInfo.PacketDataType = NASA_DATA_TYPE.NASA_DATA_ASYNCTASK;
                try
                {
                    packetInfo.PacketAsyncTask = NetasyncAjax.SendAsync(QueryString);
                    packetInfo.PacketStatus    = NASA_STATUS.NASA_REQUEST_SUCCESS;
                    NasaRequestStatus          = NASA_STATUS.NASA_REQUEST_SUCCESS;
                }
                catch
                {
                    packetInfo.PacketStatus = NASA_STATUS.NASA_REQUEST_UNSUCCESSFUL;
                    NasaRequestStatus       = NASA_STATUS.NASA_REQUEST_UNSUCCESSFUL;
                }
                ServicePointManager.SecurityProtocol = lastSecureProtocol;
                return(packetInfo);
            }
        }