F/Base/Storage/Session.cs

(开头部分) 3KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace F.Base.Storage
{
    /// <summary>
    /// [BS]  对session 的操作
    /// </summary>
    public class Session
    {

        /// <summary>
        /// [BS]返回session
        /// </summary>
        /// <param name="Key">Key值</param>
        /// <returns></returns>
        public static object Get(string Key)
        {
            try
            {
                string str = ContainsKey(Key);
                if (string.IsNullOrEmpty(str))
                {
                    return "";
                }
                return HttpContext.Current.Session[str];
            }
            catch (Exception)
            {
                return "";
            }

        }

        /// <summary>
        /// [BS]判断session是否存在
        /// </summary>
        /// <param name="key">key</param>
        /// <returns>返回true false</returns>
        public static bool Is(string key)
        {
            string str = ContainsKey(key);
            if (string.IsNullOrEmpty(str))
            {
                return false;
            }
            else { return true; }
        }


        /// <summary>
        /// [BS]返回 session的key 集合
        /// </summary>
        /// <returns>返回集合</returns>
        public static FList<object> Items()
        {
            FList<object> Lstr = new FList<object>();
后面还有 66 行代码,解锁后查看完整代码

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

AI 解读

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

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