给你提供一点代码:
string fileURL = this.Server.MapPath("你要下载的文件路径");//文件路径,可用相对路径
FileInfo fileInfo = new FileInfo(fileURL);
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=" +
Server.UrlEncode(fileInfo.Name.ToString()));//文件名
Response.AddHeader("content-length", fileInfo.Length.ToString());//文件大小
Response.ContentType = "application/octet-stream";
Response.ContentEncoding = System.Text.Encoding.Default;
Response.WriteFile(fileURL);