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

 时间:2026-02-12 03:56:44

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 = ConfigurationManager.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文档

  • 君子兰养护方法
  • 如何购买毛绒玩具
  • HALT如何停止机器运行
  • 命运战歌技能书怎么获得
  • 如何烧小龙虾
  • 热门搜索
    福建海峡旅游人才网 舟山市旅游委员会 春节去哪里旅游最好 沈阳到三亚旅游团 成都峨眉山旅游攻略 漳州云水谣旅游攻略 桂林乐满地旅游攻略 香港大屿山旅游攻略 福鼎旅游景点大全 合福高铁旅游攻略