日期:2014-05-17 浏览次数:20520 次
string strFilename = Server.MapPath(".") + "\\file.txt";
FileInfo DownloadFile = new FileInfo(strFilename);
Response.Clear();
Response.ClearHeaders();
Response.Buffer = true;
Response.Charset = "utf-8";
Response.ContentType = "application/msword";
Response.AppendHeader("Content-Disposition",
"Attachment;FileName=" +
HttpUtility.UrlEncode("123.doc", Encoding.UTF8));
Response.ContentEncoding = Encoding.UTF8;
Response.AppendHeader("Content-Length", DownloadFile.Length.ToString());
Response.WriteFile(DownloadFile.FullName);
Response.Flush();
Response.End();