I need to write some html tags into a txt file that has javascript in it as well. Can I just replace the html tag after creating the fresh tag? (if yes, how do I replace existing or old tag with new tag.). Or just recreate the whole content within that text file.
I am using VS 2010, c#, it’s a console app that I will have scheduler run 5am everyday.
So, I have 2 tags (parent div and child div). Basically I need to replace the child div. Here is the link of the txt file. I am talking about child div “slide” . This is what I need to recreate every day.
<div class="slides_container">
<div class="slide">
<a href="http://www.flickr.com/photos/jliba/4665625073/" title="145.365 - Happy Bokeh Thursday! | Flickr - Photo Sharing!" target="_blank"><img src="img/slide-1.jpg" width="570" height="270" alt="Slide 1"></a>
<div class="caption" style="bottom:0">
<p>Happy Bokeh Thursday!</p>
</div>
</div>
<div class="slide">
<a href="http://www.flickr.com/photos/stephangeyer/3020487807/" title="Taxi | Flickr - Photo Sharing!" target="_blank"><img src="img/slide-2.jpg" width="570" height="270" alt="Slide 2"></a>
<div class="caption">
<p>Taxi</p>
</div>
</div>
Thanks
Mike
I would recommend you using a HTML Parser to manipulate HTML. Html Agility Pack is great for this job.