服务器端的 office 文件存放在一个特定的目录下
并且能够知道文件的具体路径
我想在客户端浏览器上点击按钮以网页形式打开服务器上的 office 文件
请各位指点!
谢谢了! 

解决方案 »

  1.   


    public void FileTo(System.Web.UI.Page page,string strP,string File)
    {
    string Pa=page.Server.MapPath(strP+@"Template_temp/"+File+"");
    page.Response.AppendHeader("Content-Disposition","attachment;filename="+File+"");
    page.Response.ContentType ="application/类型"; 
    page.Response.WriteFile(Pa);
    page.Response.End();
    }
      

  2.   


    首先很感谢你
    另外有几个不明白的地方还请指点
     strP  :是文件在服务器上的路径吧?
     Template_temp/  :这个是什么意思?
      File :是文件名吧?
    我运行后弹出了一个没有打开按钮,只有保存和取消按钮的对话框,但不是直接打开文件,希望能够说的详细点,谢谢了!