<a href="你的文件路径">下载</a>

解决方案 »

  1.   

    大致如下,請參考:FileStream fs = new FileStream("絕對路徑", FileMode.Open, FileAccess.Read);
    BinaryReader r= new BinaryReader(fs);
    Response.Buffer=true;
    Response.AddHeader("Content-Disposition", "attachment; filename=文件名");
    Response.Charset = "GB2312";
    Response.ContentType = "application/octet-stream";
    Response.BinaryWrite(r.ReadBytes(Convert.ToInt32(fs.Length)));
    Response.Flush() ;
      

  2.   

    http://blog.csdn.net/lxs5i5j/archive/2007/02/02/1500790.aspx
      

  3.   

    试试这个
            
            string createPath = Server.MapPath("../" + FilePath);//FilePath服务器上文件相对路径
            FileInfo DownloadFile = new FileInfo(createPath);
            Response.Clear();
            Response.ClearHeaders();
            Response.Buffer = true;
            Response.ContentType = "application/octet-stream";
            Response.AddHeader("Content-Disposition", "attachment;filename=" + Server.UrlEncode(FileName));//FileName带扩展名的文件名
            Response.AddHeader("Content-Length ", DownloadFile.Length.ToString());
            Response.TransmitFile(createPath);
            Response.Flush();
            Response.End();
      

  4.   

    参考微软的讲解:
    http://www.microsoft.com/china/msdn/library/webservices/asp.net/WebDownloads.mspx?mfr=true