Click here to Skip to main content
15,889,717 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all.
I have a file xml rss and foreach item decription :


// Query the <item>s in the XML RSS data and select each one into a new Post()
C#
XDocument xDoc = XDocument.Load("http://vnexpress.net/rss/tin-moi-nhat.rss");
IEnumerable<Bus_24h> posts =
    from post in xDoc.Descendants("item")
    select new Bus_24h(post);

// Print each post to the console
foreach (var post in posts)
{
    Bus_24h tin = new Bus_24h();
    tin.Description = post.Description;
    //tin.iml_url= ???? ( <description><![CDATA[<a href="http://sohoa.vnexpress.net/tin-tuc/cong-dong/blog/nhung-tieu-chi-de-dien-thoai-viet-thanh-cong-3269249.html"><img width=130 height=100 src="http://c1.f5.img.vnecdn.net/2015/08/25/phone-1-4120-1440474313_180x108.jpg" ></a>Thị trường điện thoại luôn năng động, muốn thu hút người tiêu dùng là điều khá khó cho những nhà sản xuất mới. Vậy lý do gì khiến tôi chọn sản phẩm của bạn?</description> )
    tin.Link = post.Link;
    tin.PublishDate = post.PublishDate;
    tin.title = post.title;
    list.Add(tin);
}


I can not set tin.iml_url=scr img_url
I want to get value tag img for view Image.

please help Me, thank so much.
Posted
Updated 24-Aug-15 21:17pm
v2
Comments
Maciej Los 25-Aug-15 3:35am    
What have you tried? Where are you stuck?

1 solution

If i understand you well, you have to parse html text to be able to get image source from <img src="..."> tag.

Good point to start: How to Parse HTML using C# [^]

Another way is to use Regex[^] class.
How do I extract HTML img sources with a regular expression?[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900