下载3800个字符的字符串的问题 - HttpClient Windows Phone 7 [英] Problem to download a string of 3800 characters - HttpClient Windows Phone 7

查看:81
本文介绍了下载3800个字符的字符串的问题 - HttpClient Windows Phone 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家早上好,我在尝试下载包含3800个字符的服务的内容时遇到问题,出现以下错误:

Good morning everyone, I have a problem when trying to download the Content of a service that has 3800 characters, the following error occurs:

  System.Exception:错误HRESULT E_FAIL已从调用COM组件返回。

    at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)

   在System.Net.Browser.ClientHttpWebRequest。 <> c__DisplayClasse。 < EndGetResponse> b__d(对象发送状态)

   在System.Net.Browser.AsyncHelper。 <> c__DisplayClass1。 < BeginOnUI> b__0(对象发送状态)

    ---内部异常堆栈跟踪结束---

    at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

    at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(任务任务)

    at Microsoft.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)

    1.GetResult at Microsoft.Runtime.CompilerServices.TaskAwaiter`()

   在MyApp.ConnectionHelper。 < postActivationCode> d__0.MoveNext()}
$


我试图用PostAsync或GetAsync方法修改MaxResponseContentBufferSize参数HttpClient并且没有用,我改变了连接类型(HtttpClient,HttpWebRequest)并且发生了同样的异常,我也试图使
同步进程但是不起作用,调试器通过时间延迟停止进程。尝试以不同格式byte []和字符串流读取响应的内容时会发生此异常。所以我的问题是为什么发生这个异常,
或者我可以实现另一种方法来下载这个响应而没有问题到答案的大小。非常感谢大家。

 System.Exception: Error HRESULT E_FAIL has-been returned from a call to a COM component.
   at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse (IAsyncResult asyncResult)
   at System.Net.Browser.ClientHttpWebRequest. <> c__DisplayClasse. <EndGetResponse> b__d (Object sendState)
   at System.Net.Browser.AsyncHelper. <> c__DisplayClass1. <BeginOnUI> b__0 (Object sendState)
   --- End of inner exception stack trace ---
   at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (Task task)
   at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess (Task task)
   at Microsoft.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (Task task)
   1.GetResult at Microsoft.Runtime.CompilerServices.TaskAwaiter `()
   at MyApp.ConnectionHelper. <postActivationCode> d__0.MoveNext ()}

I tried to modify the MaxResponseContentBufferSize parameter HttpClient with methods PostAsync or GetAsync and has not worked, I changed the type of connection (HtttpClient, HttpWebRequest and WebClient) and occurred same exception, also I have tried to make synchronous process but does not work and the debugger stops the process by the time delay. This exception occurs when trying to read the contents of the response in different formats byte [] and string stream. So my question is why occurred this exception, or I can implement another method to download this response without problems to the size large of the answer. Thank you very much to all.

推荐答案

嗨丹尼尔,可能是
此链接
可以帮助您。

问候。


这篇关于下载3800个字符的字符串的问题 - HttpClient Windows Phone 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆