c# - How to recuperate the image of this rss feed ? -
i'm developing wp7 app, it's simple rss reader. i'm able recuperate date, title , description...
but when try recuperate image rss feed, catch nullreferenceexception... here wrong line :
itemrss.image = new uri(item.element("enclosure").attribute("url").value);
so, what's instruction recuperate image please ? in advance
there no "enclosure" element in feed.
when image, 1 contained in text? if so, use "content" element retrieve html , use the regex have given in answer.
var reg = new regex("src=(?:\"|\')?(?<imgsrc>[^>]*[^/].(?:jpg|bmp|gif|png))(?:\"|\')?"); var match=reg.match(source); if(match.success) { var encod = match.groups["imgsrc"].value; }
Comments
Post a Comment