[图片] // Identify the file to download including its path.
[图片] string filepath = DownloadFileName;
[图片][图片] // Identify the file name.
[图片] string filename = System.IO.Path.GetFileName(filepath);
[图片][图片] Response.Clear();
[图片][图片] // Specify the Type of the downloadable file.
[图片] Response.ContentType = "application/octet-stream";
[图片][图片] // Set the Default file name in the FileDownload dialog box.
[图片] Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
[图片][图片] Response.Flush();
[图片][图片] // Download the file.
[图片] Response.WriteFile(filepath);