• 大小: 4.94MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-17
  • 语言: C#
  • 标签: asp.net  

资源简介

文件上传js、Chart图形、Cookie&Session&Cache、CSV文件转换、DEncrypt、FTP操作类、JS、Json、Mime、PDF、Properties、ResourceManager、XML操作类、弹出消息类、导出Excel、分词辅助类、汉字转拼音、配置文件操作类、日历、上传下载、时间操作类、视频转换类、随机数类、条形码、图片、网络、文件操作类、序列化、压缩解压缩、验证码、页面辅助类、邮件、邮件2、正则表达式、字符串、SSO、SEO、过滤器、C#连接linux终端等等几十个工具操作类.

资源截图

代码片段和文件信息

using System;
using System.Web.UI.WebControls;
using System.IO;
using System.Web.UI;

namespace DotNet.Utilities
{
    public class basePage :System.Web.UI.Page
    {
        public basePage()
        {
            //
            //TODO: 在此处添加构造函数逻辑
            //
        }

        public static string title = “标题“;
        public static string keywords = “关键字“;
        public static string description = “网站描述“;

        protected override void OnInit(EventArgs e)
        {
            if (Session[“admin“] == null || Session[“admin“].ToString().Trim() == ““)
            {
                Response.Redirect(“login.aspx“);
            }
            base.OnInit(e);
        }

        protected void ExportData(string strContent string FileName)
        {

            FileName = FileName + DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString();

            Response.Clear();
            Response.Charset = “gb2312“;
            Response.ContentType = “application/ms-excel“;
            Response.ContentEncoding = System.Text.Encoding.UTF8;
            //this.Page.EnableViewState = false; 
            // 添加头信息,为“文件下载/另存为“对话框指定默认文件名 
            Response.AddHeader(“Content-Disposition“ “attachment; filename=“ + FileName + “.xls“);
            // 把文件流发送到客户端 
            Response.Write(“ta http-equiv=Content-Type content=\“text/html; charset=utf-8\“>“);
            Response.Write(strContent);
            Response.Write(““);
            // 停止页面的执行 
            //Response.End();
        }

        /// 
        /// 导出Excel
        /// 

        /// 
        public void ExportData(GridView obj)
        {
            try
            {
                string style = ““;
                if (obj.Rows.Count > 0)
                {
                    style = @“yle> .text { mso-number-format:\@; } ript> “;
                }
                else
                {
                    style = “no data.“;
                }

                Response.ClearContent();
                DateTime dt = DateTime.Now;
                string filename = dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Second.ToString();
                Response.AddHeader(“content-disposition“ “attachment; filename=ExportData“ + filename + “.xls“);
                Response.ContentType = “application/ms-excel“;
                Response.Charset = “GB2312“;
                Response.ContentEncoding = System.Text.Encoding.GetEncoding(“GB2312“);
                StringWriter sw = new StringWriter();
                HtmlTextWriter htw = new HtmlTextWriter(sw);
                obj.RenderControl(htw);
                Response.W

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      55296  2011-08-18 12:13  Galsun.Common.dll

     文件     192512  2009-08-21 22:33  ICSharpCode.SharpZipLib.dll

     文件      92160  2009-12-20 12:57  NPOI.DDF.dll

     文件       9728  2009-12-20 13:16  NPOI.dll

     文件      53248  2009-12-20 13:16  NPOI.HPSF.dll

     文件     964608  2009-12-20 13:33  NPOI.HSSF.dll

     文件      49664  2009-12-20 13:16  NPOI.POIFS.dll

     文件      39424  2009-12-20 12:57  NPOI.Util.dll

----------- ---------  ---------- -----  ----

              1456640                    8


评论

共有 条评论