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

2025-04-18 10:18:04

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文档
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
相关推荐
  • 阅读量:47
  • 阅读量:86
  • 阅读量:43
  • 阅读量:41
  • 阅读量:67
  • 猜你喜欢