/// <summary> /// 文件下载 /// </summary> /// <param name="strFullFilepath"></param> protected void DownLoadAttachment(string strFullFilepath) { #region if (strFullFilepath != "") { string path = strFullFilepath; System.IO.FileInfo file = new System.IO.FileInfo(path); if (file.Exists) { Response.Clear(); Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name); Response.AddHeader("Content-Length", file.Length.ToString()); Response.ContentType = "application/octet-stream"; Response.Filter.Close(); Response.WriteFile(file.FullName); Response.End(); } else { base.Alert("资源不存在!"); } } #endregion }