How to ReadHtmlFile in string

class of reading HTML file
-----------------------------------------------------------------------------------------------------------------------

public static System.Text.StringBuilder ReadHtmlFile(string htmlFileNameWithPath)
    {
        System.Text.StringBuilder htmlContent = new System.Text.StringBuilder();
        string line;
        try
        {
            using (System.IO.StreamReader htmlReader = new System.IO.StreamReader(htmlFileNameWithPath))
            {

                while ((line = htmlReader.ReadLine()) != null)
                {
                    htmlContent.Append(line);
                }
            }
        }
        catch (Exception objError)
        {
            throw objError;
        }

        return htmlContent;
    }

-----------------------------------------------------------------------------------------------------------------------


htmlTx = Convert.ToString(ReadHtmlFile(Server.MapPath("/Bill/Bill_PrintHtml/maininvoice_4A.html")));








Comments

Popular posts from this blog

Forms