protected void Page_Load(object sender, EventArgs e)
    {
        string guid = Request.QueryString["GUID"];
        string sql = "select XSMC,FJMC,LJ from T_AQGL_FJ where GUID='" + guid + "'";
        CX.DBGetResult dbgr = new CX.DBGetResult(CX.AppInfo.DBMS, CX.AppInfo.ConStr);
        DataTable table = dbgr.GetDataTable(sql);
        string xsmc = table.Rows[0]["XSMC"].ToString();
        string fjmc = table.Rows[0]["FJMC"].ToString();
        string lj = table.Rows[0]["LJ"].ToString();
        HttpResponse _Response = HttpContext.Current.Response;
        FileInfo fileInfo = new FileInfo(Server.MapPath(lj));
        _Response.Clear();
        _Response.ClearHeaders();
        _Response.Buffer = false;
        _Response.ContentType = "application/octet-stream";
        _Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(xsmc, System.Text.Encoding.UTF8));
        _Response.AppendHeader("Content-Length", fileInfo.Length.ToString());
        _Response.WriteFile(fileInfo.FullName);
        _Response.Flush();
        _Response.End();

    }

相关文章:

  • 2021-11-22
  • 2022-12-23
  • 2021-07-20
  • 2022-12-23
  • 2022-01-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
  • 2021-12-25
  • 2022-01-29
  • 2021-08-24
相关资源
相似解决方案