gossip

           //在浏览其中打开word文件

            Response.ClearContent();

            Response.ClearHeaders();

            Response.ContentType = "Application/msword";

            string strFilePath = "";

            strFilePath = Server.MapPath("高手帮你学习LINQ.doc");  //Word路径

            FileStream fs = new FileStream(strFilePathFileMode.OpenOrCreateFileAccess.Read);

            Response.WriteFile(strFilePath, 0, fs.Length);

            fs.Close();

   

            //在浏览其中打开Excel文件

            Response.ClearContent();

            Response.ClearHeaders();

            Response.ContentType = "application/vnd.ms-excel";

            Response.WriteFile(Server.MapPath("Book1.xls")); //Excel路径

            Response.Flush();

            Response.Close();

分类:

技术点:

相关文章:

  • 2021-12-12
  • 2021-12-22
  • 2021-11-05
  • 2021-10-03
  • 2021-07-09
  • 2021-06-26
  • 2021-11-20
猜你喜欢
  • 2022-01-15
  • 2021-12-22
  • 2021-12-22
  • 2021-12-04
  • 2021-12-22
相关资源
相似解决方案