输出文件类型和文件,ie会自动调用客户端的程序打开。你问毛毛雨,他做过。你发短消息给他。

解决方案 »

  1.   

    你附件的超连接指向一个新的页面,传一个File参数给它 
    在这个新页面的page_load 中写以下代码  
    string path = Server.MapPath(Request.Params["File"]);//File为你的附件路径
            System.IO.FileInfo file = new System.IO.FileInfo(path);
            Response.Clear();
            Response.AddHeader("Content-Disposition", "attachment; filename=" +file.Name);
            Response.AddHeader("Content-Length", file.Length.ToString());
            Response.ContentType = "application/octet-stream";
            Response.WriteFile(file.FullName);
            Response.End();