//定义写文件流
string htmlTempStr = File.ReadAllText(GetRelativePath("\\html.html"));
string stroutput = htmlTempStr.Replace("<body></body>", "<body>"+ strHtml + "</body>");
//写入的内容
File.WriteAllText(GetRelativePath("\\html.html"), stroutput);
GetRelativePath()是将绝对路径转成相对路径的方法