页面文件预览,在线等
需求:有一个word,想将他显示在一个新的页面中。
现有代码:
string strFilename = "C:\\Users\\admin\\Desktop\\aa.doc";
System.IO.FileInfo DownloadFile = new System.IO.FileInfo(strFilename);
Response.Clear();
Response.ClearHeaders();
Response.Buffer = true;
Response.Charset = "utf-8";
Response.ContentType = "application/msword";
Response.AppendHeader("Content-Disposition",
"Attachment;FileName=" +
HttpUtility.UrlEncode("qqq.doc", Encoding.UTF8));
Response.ContentEncoding = Encoding.UTF8;
Response.AppendHeader("Content-Length", DownloadFile.Length.ToString());
Response.WriteFile(DownloadFile.FullName);
Response.Flush();
Response.End();
结果成了下载了!我不是要下载下来 是要到新的页面将word里面的东西显示出来!