0

How can I get string that is between " and " and also is in <IMG ... >

So simply, how to get this:

file:///C:/abc.png
file:///C:/cba.png

from this:

<BODY>
    <IMG alt="" src="file:///C:/abc.png"><br>
    <IMG alt="" src="file:///C:/cba.png">
</BODY>

The information is received dynamically

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
KariiO
  • 9
  • 1
  • 5
  • why in csharp? I mean.. how in csharp are you reading an html page? – celerno Nov 30 '15 at 19:11
  • 3
    [Html Agility Pack](https://htmlagilitypack.codeplex.com/) is going to make your life so much easier. – Banana Nov 30 '15 at 19:12
  • WYSIWYG, user create a note then I sending this to database and after it display on page. – KariiO Nov 30 '15 at 19:13
  • @Banana How it can help me when I need to take a path of images from string with HTML code? – KariiO Nov 30 '15 at 19:14
  • 2
    If you actually search on what you want to do (so: "C# find img src in html" instead of "many substring what contain another substring"), you'll find two approaches: using a RegEx and using HtmlAgilityPack. See [duplicate](http://stackoverflow.com/questions/4835868/how-to-get-img-src-or-a-hrefs-using-html-agility-pack) for the proper approach, which is the latter. – CodeCaster Nov 30 '15 at 19:16
  • @KariiO html agility pack presents you with a document object from which you can manipulate the html simply as html instead of a long string. see CodeCasters link or [This](http://stackoverflow.com/questions/2113924/how-can-i-use-html-agility-pack-to-retrieve-all-the-images-from-a-website) link for reference. – Banana Nov 30 '15 at 19:18

0 Answers0