WELOA.Web/sb/admin/login_testing_search.aspx.cs

(开头部分) 20KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WELOA.Model;
using SBBLL;
using LSBLL;
using System.IO;
using System.Text;
using System.Data;

namespace Web.sb.admin
{
    public partial class login_testing_search : System.Web.UI.Page
    {
        
    
        private DateSetInformation dsinfo = new DateSetInformation();
       
        private SB_Lendandreturn lendBLL = new SB_Lendandreturn();
        private SB_Storage storageBLL = new SB_Storage();
        private string strCategories = "";
        private string strDays = "";
        private string strDevicename = "";
        private string strDevicenumber = "";
        private string strSn = "";
        private SB_System systemBLL = new SB_System();
      
        private SB_Testing testingBLL = new SB_Testing();
        private Polytechnic trinfo = new Polytechnic();
        private LS_xls xlsBLL = new LS_xls();

        
        protected void btExcel_PreTest_Click(object sender, EventArgs e)
        {
            string path = base.Server.MapPath(@"\") + "temp";
            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
            string filePath = string.Concat(new object[] { path, @"\", DateTime.Now.ToString("yyyyMMddHHmmss"), new Random().Next(0x270f), ".xls" });
            try
            {
                if (this.xlsBLL.Write_xls(this.selectDate_Protest(), filePath).nException > 0)
                {
                    this.Page.ClientScript.RegisterStartupScript(base.GetType(), "", "<script>alert('创建文件异常,请重试。')</script>");
                }
                else
                {
                    using (FileStream stream = new FileStream(filePath, FileMode.OpenOrCreate))
                    {
                        base.Response.Clear();
                        base.Response.Buffer = true;
                        base.Response.Charset = "GB2312";
                        base.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("库存中待检测设备明细表", Encoding.UTF8) + ".xls");
                        base.Response.ContentEncoding = Encoding.GetEncoding("GB2312");
                        base.Response.ContentType = "application/ms-excel";
                        byte[] buffer = new byte[stream.Length - 1];
后面还有 351 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。