using System.IO;
using System.Text;

namespace XmlToHtml
{
    public static class HtmlReplace
    {
        private static string HtmlFile { get; set; }

        public static void Replace(string pathWay)
        {
            using (var fs = new FileStream(pathWay, FileMode.Open))
            {
                using (var w = new StreamReader(fs, Encoding.UTF8))
                {
                    HtmlFile = w.ReadToEnd().Replace("!br", "<br/>").Replace("!b", "<b>").Replace("b!", "</b>");
                }
            }

            using (var fs = new FileStream(pathWay, FileMode.Open))
            {
                using (var w = new StreamWriter(fs, Encoding.UTF8))
                {
                    w.WriteLine(HtmlFile);
                }
            }
        }
    }
}
