WP7将Image设置为HttpBasicAuthenticator后面的源代码

时间:2011-08-22 14:52:18

标签: silverlight authentication windows-phone-7 http-authentication

我正在尝试在Windows Phone 7应用程序中设置图像,有一个问题,图像所在的网址需要Authenticator,我有一个有效的用户名和密码,但我不知道如何加载image使用Authenticator进行URI?

        ProfileImage.Source = new BitmapImage(new Uri(userObject.ProfileImage));

1 个答案:

答案 0 :(得分:0)

除非您可以使用身份验证网址,即。 http://username:password@domain.tld/image.png然后您需要先在本地下载图像,然后再加载它。

您可以为其编写自定义处理程序,将其下载到隔离存储,然后自动更新UI,同时在加载时使用后备图像(通常为空白)。