Web/Tools/GoodsItemAction.ashx.cs

(开头部分) 14KB

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

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

        public void ProcessRequest(HttpContext context)
        {
            string action = context.Request.Params["action"];
            //context.Response.Write(password);如果使用加密,则写入数据库要加密后的字段,然后登陆的时候就用加密后的字符串匹配
            //此处连接数据库查看是否有此用户,此处为了方便起见,直接判断
            if (action == "compare")
            {
                string gid = context.Request["gid"].ToString();
                int count = 0;
                DataTable cart=null;
                try
                {
                    cart = (DataTable)HttpContext.Current.Session["BiPinCart"];
                    count = cart.Rows.Count;
                }
                catch
                {
                    count = 0;
                }
                if (count>=4)
                {
                    context.Response.Write("0");
                }
                else if (cart==null)
                {
                    UbuyServer.Server.BuildCart(gid);
                    context.Response.Write("1");
                }
                else if (UbuyServer.Server.Existproduct(cart, gid))
                {
                    UbuyServer.Server.BuildSession(cart,gid);
                    context.Response.Write("1");
                }
                else
                {
                    context.Response.Write("2");
                }
            }
            else if (action == "addcompare")
            {
                string gid = context.Request["gid"].ToString();
                int count = 0;
                DataTable cart = null;
                try
                {
                    cart = (DataTable)HttpContext.Current.Session["BiPinCart"];
                    count = cart.Rows.Count;
后面还有 336 行代码,购买后查看完整代码

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

AI 解读 AI

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

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