标签:style blog http color os io 文件 ar
public static void DownLoadFile(HttpRequest _Request, HttpResponse _Response, string fileName, string fullPath) { FileInfo fileInfo = new FileInfo(fullPath); if (fileInfo.Exists) { _Response.Clear(); _Response.ClearHeaders(); _Response.Buffer = false; _Response.ContentType = "application/octet-stream"; _Response.ContentEncoding = Encoding.UTF8; _Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName); _Response.AppendHeader("Content-Length", fileInfo.Length.ToString()); _Response.TransmitFile(fullPath, 0L, fileInfo.Length); _Response.WriteFile(fileInfo.FullName); _Response.Flush(); _Response.End(); _Response.Close(); } }
标签:style blog http color os io 文件 ar
原文地址:http://www.cnblogs.com/zhaolijing910/p/3910102.html