在Windows Phone 8.1中,无法从URI下载Html文件。虽然在Windows 8.1中同样有效 [英] In Windows Phone 8.1, Not able to download Html file from URI. While same works in windows 8.1

查看:78
本文介绍了在Windows Phone 8.1中,无法从URI下载Html文件。虽然在Windows 8.1中同样有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我是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

推荐答案

请检查HTML Uri是否具有打开它的凭据。

Please check whether the HTML Uri have the credentials to open it.

如果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中同样有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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