var img = new Image() ;
var bi = new BitmapImage();
// with this Uri it works
//bi.UriSource = new Uri("http://img.cnbeta.com/newsimg/120514/13540001507152531.jpg", UriKind.Absolute);
// with this Uri it doesnt work
bi.UriSource = new Uri("http://img.cnbeta.com/newsimg/120514/13540001507152531.jpg", UriKind.Absolute);
bi.ImageFailed += (object sender, ExceptionRoutedEventArgs ea) =>
{
// error!
// ea.ErrorException
};
img.Source = bi;
在IE下面能打开,放到应用中就打不开了,很奇怪,监测错误后,得知报的错误时:AG_E_NETWORK_ERROR。同样的代码,A网站的URL地址全部可以正常加载,B网站却不行,不知道为什么