问题描述
大家好,我是b $ b我试图从我的通用应用程序中使用以下代码从url下载HTML文件
Hi Guys,
I am trying to download HTML file from url with following code in my universal app
以下是代码
httpClient = new HttpClient();
var result = await httpClient.GetAsync(new Uri(" http:// ...... html"));
但上述代码在Windows 8中有效,但在Windows Phone 8.1中有例外。 以下是例外
But the same above code works in Windows 8 but gives exception in Windows Phone 8.1. following is the exception
"错误HRESULT E_FAIL已从调用COM返回。组分QUOT;
我也使用了背景下载程序,但也提供了例外情况。
i have also used background downloader but gives exception too
所以请更新我,如果我在这里遗漏任何东西
提前致谢
So please kindly update me if i am missing anything here
Thanks in advance
推荐答案
如果URL本身包含凭据,请将其从URL中删除。
If the URL itself contains the credentials, Remove it from Url.
使用"HttpClientHandler" 使用带有"HttpClient"的凭据
Use "HttpClientHandler" using the credentials with the "HttpClient"
这篇关于在Windows Phone 8.1中,无法从URI下载Html文件。虽然在Windows 8.1中同样有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!