Web/Tools/AdminAction.ashx.cs

(开头部分) 5KB

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

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.SessionState;
using System.Data;
using Common;
using System.Text;
namespace Web.Tools
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    public class AdminAction : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            string action = context.Request.Params["action"];
            //context.Response.Write(password);如果使用加密,则写入数据库要加密后的字段,然后登陆的时候就用加密后的字符串匹配
            //此处连接数据库查看是否有此用户,此处为了方便起见,直接判断
            BLL.Pictures bll = new BLL.Pictures();
            if (action == "goodslist")
            {
                try
                {
                    int cid = int.Parse(context.Request["cid"].ToString());
                    if (cid == 0)
                    {
                        context.Response.Write("{\"issuccess\":\"false\", \"message\":\"该分类暂无商品\"}");
                    }
                    else
                    {
                        DataSet ds = bll.GetList("classid=" + cid);
                        StringBuilder strSql = new StringBuilder();
                        strSql.Append("{\"dt\":[");
                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            DataRow dr = ds.Tables[0].Rows[i];
                            if (i == ds.Tables[0].Rows.Count - 1)
                            {
                                strSql.Append("{\"ID\":\"" + dr["id"] + "\",\"GoodsName\":\"" + dr["title"] + "\"}");
                            }
                            else
                            {
                                strSql.Append("{\"ID\":\"" + dr["id"] + "\",\"GoodsName\":\"" + dr["title"] + "\"},");
                            }
                        }
                        strSql.Append("]}");
                        context.Response.Write(strSql);
                    }
                }
                catch
                {
                    context.Response.Write("{\"issuccess\":\"false\", \"message\":\"该分类暂无商品\"}");
                }
            }
            if (action == "price")
            {
                //try
                //{
后面还有 40 行代码,购买后查看完整代码

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

AI 解读 AI

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

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