asp.net生成静态HTML时汉字变成乱码
这是我写的生成静态HTML的代码:StreamReadersr;StreamWritersw;WebRequestHttpWebRequest=WebRequest.Cr...
这是我写的生成静态HTML的代码:
StreamReader sr;
StreamWriter sw ;
WebRequest HttpWebRequest = WebRequest.Create("http://localhost/China-Service/WebForm1.aspx");
WebResponse HttpWebResponse =HttpWebRequest.GetResponse();
sr=new StreamReader(HttpWebResponse.GetResponseStream(),System.Text.Encoding.Default);
string strHtml=sr.ReadToEnd();
sw=File.CreateText(Server.MapPath("liu.html"));
sw.WriteLine(strHtml);
sw.Close();
Response.WriteFile(Server.MapPath("liu.html")); 展开
StreamReader sr;
StreamWriter sw ;
WebRequest HttpWebRequest = WebRequest.Create("http://localhost/China-Service/WebForm1.aspx");
WebResponse HttpWebResponse =HttpWebRequest.GetResponse();
sr=new StreamReader(HttpWebResponse.GetResponseStream(),System.Text.Encoding.Default);
string strHtml=sr.ReadToEnd();
sw=File.CreateText(Server.MapPath("liu.html"));
sw.WriteLine(strHtml);
sw.Close();
Response.WriteFile(Server.MapPath("liu.html")); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询