62,041
社区成员
发帖
与我相关
我的任务
分享
string name = @"c:\123.rar";
FileInfo aFile = new FileInfo(name);
Response.Clear();
Response.ClearHeaders();
Response.BufferOutput = false;
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-disposition", "attachment;filename=" + HttpUtility.UrlEncode("123.rar", Encoding.UTF8));
Response.AddHeader("Content-Length", aFile.Length.ToString());
Response.WriteFile(name);
Response.Redirect("~/default.aspx");