谁给个ASP下载的代码
RT --------------------编程问答-------------------- --------------------编程问答-------------------- http://www.51aspx.com/ --------------------编程问答-------------------- 慢了中国站长 也有 --------------------编程问答-------------------- private void DownLoadFile(string fileName)
{
string filePath = Server.MapPath(".") + "\\" + fileName;
if (File.Exists(filePath))
{
FileInfo file = new FileInfo(filePath);
Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8"); //解决中文乱码
Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode(file.Name)); //解决中文文件名乱码
Response.AddHeader("Content-length", file.Length.ToString());
Response.ContentType = "appliction/octet-stream";
Response.WriteFile(file.FullName);
Response.End();
}
}
你试试`~~~~~~
补充:.NET技术 , ASP.NET