DotBBS.Common/DotSession.cs

(开头部分) 1KB

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

#region Usings
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Text.RegularExpressions;
using System.Configuration;
using System.Web.Security;
#endregion

//============================================================================
// 官方支持:DotBBS.Net   作者:吸铁石团队(水煮鱼)
//============================================================================
namespace DotBBS.Common
{
    public class DotSession
    {
        static public void Add(string Key, string Value)
        {
            HttpContext.Current.Session[Key] = Value;
        }

        static public bool Exists(string Key)
        {
            try
            {
                bool b = true;
                if (HttpContext.Current.Session[Key] == null || HttpContext.Current.Session[Key].ToString() == "")
                {
                    b = false;
                }
                return b;
            }
            catch (Exception ex)
            {
                throw new Exception(Key+" "+ex.Message);
            }
        }

        static public void Delete(string Key)
        {
            HttpContext.Current.Session[Key] = "";
        }

        static public string Read(string Key)
        {
            if (Exists(Key))
            {
                return HttpContext.Current.Session[Key].ToString();
            }
            else
            {
                return "";
            }
        }

        static public string ReadAll()
        {
            string ret="";
            for (int i = 0; i < HttpContext.Current.Session.Keys.Count; i++)
后面还有 7 行代码,购买后查看完整代码

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

AI 解读 AI

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

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