asp.net c#怎么读取word文件并在web中显示

2024-12-29 05:52:38
推荐回答(1个)
回答1:

Response.ContentType = "application/msword";
Response.AddHeader("Content-Disposition","attachment;filename=" +
HttpUtility.UrlEncode(file.FILENAME).Replace("+","%20"));// 防止乱码
Response.Charset="UTF-8";
Response.ContentEncoding=System.Text.Encoding.Default;
Response.BinaryWrite(文件流);
Response.End();