SOA/GetDiary.ashx.cs

(开头部分) 2KB

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

using System;
using System.Collections.Generic;
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.SOA
{
    public class GetDiary : 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;
            }
            #endregion
            
            string sql;
            SqlConnection 数据连接;
            SqlCommand sqlCmd = new SqlCommand();
            string date = context.Request.QueryString["date"].ToString();
            date = date.Replace("年", ".").Replace("月", ".").Replace("日", ""); 
            sql = "select 日志 from 系统_工作日志 where 用户名称='" + context.Session["username"] + "' and 日期='" + date + "'";
            数据连接 = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["默认连接_3HK0R6GAS"].ConnectionString);
            try
            {
                数据连接.Open();
                sqlCmd.Connection = 数据连接;
                sqlCmd.CommandText = sql;
                object obj = sqlCmd.ExecuteScalar();
                数据连接.Close();
                context.Response.ContentType = "text/html";
                if (obj == null)
                {
                    context.Response.Write("");
                }
                else
                {
                    context.Response.Write(obj.ToString());
                }
            }
            catch
            {
                context.Response.Write("(访问失败)");
            }
        }

        public bool IsReusable
        {
            get
            {
后面还有 5 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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