110,533
社区成员
发帖
与我相关
我的任务
分享
System.IO.FileInfo file = new System.IO.FileInfo(文件路径);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(文件名));
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(file.FullName);
Response.Flush();
Response.Clear();
Response.End();