Publics/FileDownLoadF.ashx.cs

(开头部分) 5KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Web.SessionState;

namespace 客户订单管理2.Publics
{
    public class FileDownloadF : IHttpHandler, IRequiresSessionState
    {
        public void ProcessRequest(HttpContext context)
        {
            #region 权限检查
            if (context.Session["login"] == null || context.Session["login"].ToString() != "true")
            {
                context.Response.Write("<script>top.location.href='../Default.aspx';</script>");
                context.Response.End();
                return;
            }
            if (!系统.权限检查(context.Session["pageTitle"].ToString(), context.Session["username"].ToString(), context.Session["userclass"].ToString()))
            {
                context.Response.Write("<script>alert('缺少访问权限 !(请联系管理员)');</script>");
                context.Response.Write("<script>history.go(-1);</script>");
                context.Response.End();
                return;
            }
            #endregion

            string key = context.Request.QueryString["Key"].ToString();
            key = 系统.解密(key.Replace("_", "+"));
            string fieldName = context.Request.QueryString["Field"].ToString();
            fieldName = 系统.解密(fieldName.Replace("_", "+"));
            string tableName = context.Request.QueryString["Table"].ToString();
            tableName = 系统.解密(tableName.Replace("_", "+"));
            string keyValue = context.Session["keyValue"].ToString();
            
            string fileName = "";
            SqlCommand sqlCmd = new SqlCommand();
            SqlConnection sqlConn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["默认连接_3HK0R6GAS"].ConnectionString);
            sqlCmd.Connection = sqlConn;
            sqlCmd.CommandText = "SELECT " + fieldName + " FROM " + tableName + " WHERE " + key + " = '" + keyValue + "'";
            try
            {
                sqlConn.Open();
                object obj = sqlCmd.ExecuteScalar();
                if (obj != null)
                {
                    fileName = (string)obj;
                    fileName = fileName.Trim();
                }
            }
            catch
            {
                fileName = "";
            }
后面还有 65 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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