把xls文件放在站点的目录下面:Response.Redirect("http://URL/Doc/" + Request.QueryString("strings") + ".xls")

解决方案 »

  1.   

    请问MapPath怎么用呢?请给一段代码 谢谢
      

  2.   

    Request.MapPath("/url/doc/" + Request.QueryString("strings") + ".xls")
      

  3.   

    错了错了,我写错了
    Response.Redirect(Request.MapPath("/url/doc/")+Request.QueryString("strings") + ".xls")
      

  4.   

    虚拟路径对应的物理路径:
    this.Mappath(page.templatesourcedirectory).tostring()
      

  5.   

    以上方法好像都有问题,用Request.MapPath打开会出现空白页
    我是用这样的方法打开的
    Response.Redirect("../HBxls/" + Request.QueryString("strings") + ".xls")
    将F:\HeBaoData\Doc\ 设置成默认虚拟站点,名字叫HBxls
      

  6.   

    很奇怪,我用mappath的方法只能打开一个空页,并不显示xls文档内容
      

  7.   

    Request.MapPath使用来获取服务端本地路径的,不合适这里的情况,还是:
    Response.Redirect("http://URL/Doc/" + Request.QueryString("strings") + ".xls")
    或者相对路径:
    Response.Redirect("Doc/" + Request.QueryString("strings") + ".xls")