コード例 #1
0
        private static string GetPostData(CefRequest request)
        {
            if ((request == null) || (request.PostData == null))
            {
                return(string.Empty);
            }

            CefPostDataElement[] postDataElements = request.PostData.GetElements();

            if ((postDataElements == null) || (postDataElements.Length == 0))
            {
                return(string.Empty);
            }

            CefPostDataElement dataElement = postDataElements[0];

            switch (dataElement.ElementType)
            {
            case CefPostDataElementType.Empty:
                break;

            case CefPostDataElementType.File:
                break;

            case CefPostDataElementType.Bytes:
                return(Encoding.UTF8.GetString(dataElement.GetBytes()));
            }

            return(string.Empty);
        }
コード例 #2
0
        public void Append(CefPostDataElement element)
        {
            var numBytes = (int)element.BytesCount;

            if (numBytes > 0)
            {
                var bytes = element.GetBytes();
                Raw += Encoding.Default.GetString(bytes);
            }
        }
コード例 #3
0
        public PostHelper(CefPostDataElement element)
            : this()
        {
            var numBytes = (int)element.BytesCount;

            if (numBytes > 0)
            {
                var bytes = element.GetBytes();
                Raw = Encoding.Default.GetString(bytes);
            }
        }