Windows.Networking.BackgroundTransfer.UploadOperation.GetResultStreamAt C# (CSharp) Method

GetResultStreamAt() public method

public GetResultStreamAt ( [ position ) : IInputStream
position [
return IInputStream
		public extern IInputStream GetResultStreamAt([In] ulong position);
		public extern ResponseInformation GetResponseInformation();

Usage Example

        private async static Task<string> GetResponseMessage(UploadOperation uploadOperation)
        {
            ResponseInformation responseInformation = uploadOperation.GetResponseInformation();

            //uint contentLength = Convert.ToUInt32(responseInformation.Headers["Content-Length"]);

            uint contentLength = (uint)uploadOperation.Progress.BytesReceived;

            uint statusCode = responseInformation.StatusCode;

            IInputStream resultStreamAt = uploadOperation.GetResultStreamAt(0);

            IBuffer result = await resultStreamAt.ReadAsync(
                new Windows.Storage.Streams.Buffer(contentLength),
                contentLength,
                InputStreamOptions.None);

            Stream responseStream = result.AsStream();

            XDocument xDocument = XDocument.Load(responseStream);

            foreach (XElement xe in xDocument.Root.Descendants())
            {
                if (xe.Name.LocalName.Equals("Ok"))
                {
                    return "SUCCESS";
                }
                if (xe.Name.LocalName.Equals("Error"))
                {
                    return xe.Value;
                }
            }
            return "Unspecified error submiting video";
        }
All Usage Examples Of Windows.Networking.BackgroundTransfer.UploadOperation::GetResultStreamAt