我想根据模办生成html页面,总是不成功,可能是编码的问题
string strTemplate = Server.MapPath( "") + "\\Doctemplate.htm";
StreamReader sr = new StreamReader( strTemplate,System.Text.Encoding.GetEncoding("GB2312"));
StreamWriter sW = File.CreateText(strTargetFile);
string input;
string Src="";
while ((input=sr.ReadLine())!=null)
{
Src +=input;
}
sr.Close();
Src.Replace( "{$Content}",TxtContent.Text.ToString());
sW.Write(Src);
sW.Close();