• 下载


    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using Common.ValueObject;
    using BusinessLogic;
    using System.IO;

    public partial class Admin_Down : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            TB_WenZhanFormVO formVo = new TB_WenZhanFormVO();
            //取得更新ID
            formVo.Id = Convert.ToInt32(Request["ID"].Trim()).ToString();
            //取得数据并放入到FORMVO内
            formVo = new TB_WenZhanBL().GetData(formVo);
            // Response.Redirect("../Upload/" + formVo.GH_WenZhanFenLeiId + "/" + formVo.GH_FileName);
            string strFilepath = Server.MapPath("~") + "Upload/" + formVo.GH_WenZhanFenLeiId + "/" + formVo.GH_FileName;
            if (!File.Exists(strFilepath))
            {
                Response.Write("<center><font color='red' size='14pt'>你要下载的文件不存在。</font><br><a href='javascript:history.go(-1)'><b>返回</b></a></center>");

            }
            else
            {
                Response.ContentType = "application/x-zip-compressed";
                string strFilename = formVo.GH_FileName;
                if (strFilename.IndexOf(".") > 0)
                {
                    strFilename = strFilename.Substring(strFilename.IndexOf("."));
                    strFilename = formVo.Id + strFilename;

                }

                Response.AddHeader("Content-Disposition", "attachment;filename=" + strFilename);
                //string filename = Server.MapPath("DownLoad/CodeShark.zip");
                Response.TransmitFile(strFilepath);


            }
            Response.Write(strFilepath);
        }
    }

  • 相关阅读:
    mysql之存储过程
    Artificial Intelligence in Finance
    7 Exciting Uses of Machine Learning in FinTech
    Machine Learning in Finance – Present and Future Applications
    AI AND THE BOTTOM LINE: 15 EXAMPLES OF ARTIFICIAL INTELLIGENCE IN FINANCE
    5 Ways AI is Transforming the Finance Industry
    图学Kubernetes
    Free Professional Resume Examples and Writing Tips
    npm和yarn的淘宝镜像添加
    世界最具影响力的十大管理大师
  • 原文地址:https://www.cnblogs.com/jishu/p/1940067.html
Copyright © 2020-2023  润新知