this tips can help you.StreamReader is used to read
the file and store data in Stringbuilder.you can modify
the Stringbuilder according to your need.
Here the following method does that.the html file with
location is passed to the method.after getting the
content of the html file in StringBuilder,the method
returns it.then you can write back the content to the
html file again.
public static System.Text.StringBuilder ReadHtmlFile(string htmlFileNameWithPath)
System.Text.StringBuilder storeContent = new System.Text.StringBuilder();
using (System.IO.StreamReader htmlReader = new System.IO.StreamReader(htmlFileNameWithPath))
while ((lineStr = htmlReader.ReadLine()) != null)
catch (Exception objError)
If you have any kind of questions on this post or any topic, post your questions in
discussions/forum page in this website, you will get your answer.
Hope this tip/tutorial helped you a lot.Don't forget to like and share.