zoukankan      html  css  js  c++  java
  • 最新的导出文档方法



    // 最新的导出文档方法
    说明:参数 dt 可以是Html字符串

    public void ExportToExcel(string FieldType, string FileName, string dt) { System.Web.HttpContext.Current.Response.Charset = "utf-8"; System.Web.HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(FileName, System.Text.Encoding.UTF8).ToString()); System.Web.HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); System.Web.HttpContext.Current.Response.ContentType = FieldType; StringWriter tw = new StringWriter(); System.Web.HttpContext.Current.Response.Output.Write(dt); System.Web.HttpContext.Current.Response.Flush(); System.Web.HttpContext.Current.Response.End(); }
  • 相关阅读:
    iou与giou对比
    Linux学习第一天 vim
    奖励加分申请
    人月神话阅读笔记3
    5.27
    5.26
    5.25
    5.23
    5.22
    5.21
  • 原文地址:https://www.cnblogs.com/ly77461/p/6934634.html
Copyright © 2011-2022 走看看