C# MVC 返回html内容
var ss = Server.MapPath(""); //C:\Users\Administrator\Desktop\Csharp测试程序\TestMVC\TestMVC ss = ss + "/bin/index.html"; using (StreamReader sr = new StreamReader(ss, System.Text.Encoding.GetEncoding("gb2312"))) //以gb2312编码方式读取 { string htmlContent = sr.ReadToEnd(); return Content(htmlContent); }
//StreamReader sr = new StreamReader(path,Encoding.Default) //Encoding.Default 该编码方式没有gb2312