注册 登录
编程论坛 ASP.NET技术论坛

[求助]导入excel出现的问题

leisky 发布于 2007-08-31 16:27, 593 次点击

public void SaveXml(string xmlString)
{
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=Excel.xls");
HttpContext.Current.Response.Charset = "UTF-8";
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8;
HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"; //"application/ms-excel";
this.EnableViewState = false;
HttpContext.Current.Response.Write(xmlString);
HttpContext.Current.Response.End();

}
为什么用上面那个方法导入excel为出现下面的乱码????excel用的是2007........

鎸囨爣
瀹㈡埛缂栧彿 寮

2 回复
#2
bygg2007-08-31 17:04
= System.Text.Encoding.UTF8;  把这里改成Default....
#3
leisky2007-09-05 17:19
厉害。。谢谢老兄
1