zoukankan      html  css  js  c++  java
  • 下载

    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);
        }
    }

  • 相关阅读:
    jade反编译,把html编译成jade
    runtime环境下的jade
    jade过滤器
    jade-render-renderFile
    【[USACO17DEC]Standing Out from the Herd】
    bzoj 1396: 识别子串
    bzoj 4327:JSOI2012 玄武密码
    hihocoder 后缀自动机四·重复旋律6
    hihocoder 后缀自动机四·重复旋律7
    【[CTSC2012]熟悉的文章】
  • 原文地址:https://www.cnblogs.com/jishu/p/1940067.html
Copyright © 2011-2022 走看看