手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

MVC如何在html页面显示word文档

时间:2024-10-11 20:30:33

1、页面 <挢旗扦渌;div class="cont"> <span class="label">操作手册</span> <a href="/home/path" class="btn">下载</a> </div>

MVC如何在html页面显示word文档

2、HomeController引用dll public ActionResult ViewManual() { try {

MVC如何在html页面显示word文档

3、 string virtualURL = Configuratio艘绒庳焰nManager.AppSettings["ManualPath"].ToString(); string physicalPath = Server.MapPath(Server.UrlDecode(virtualURL)); if (string.IsNullOrEmpty(virtualURL) || !System.IO.File.Exists(physicalPath)) {

MVC如何在html页面显示word文档

4、 string extension = Path.GetExtension(physicalPath); string htmlUrl = ""; switch (extension.ToLower()) {

MVC如何在html页面显示word文档

5、 case ".doc": case ".docx": htmlUrl = PreviewWord(physicalPath, virtualURL); break; }

MVC如何在html页面显示word文档
© 手抄报圈