欧美日韩一区二区三区四区不卡,日韩欧美视频一区二区三区四区,久久精品欧美一区二区三区不卡,国产精品久久久乱弄

咨詢電話:186 7916 6165 咨詢電話:186 7916 6165 (微信同號)    在線QQ:181796286
NEWS BLOG ·
學無止境
關注開優網絡 關注前沿
ASP.NET公共類庫之分頁類PageListUtil.cs
ASP.NET公共類庫之Smtp郵件輔助類SmtpMail.cs

ASP.NET公共類庫之Session封裝SessionAdapter.cs

發表日期:2015-09-06    文章編輯:南昌開優網絡    瀏覽次數:3848    標簽:ASP.NET應用

/**********************************************
 * 類作用:   Session封裝
 * 作者:開優網絡
 * http://www.568387.com
 ***********************************************/

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

namespace Svnhost.Common
{
    /// <summary>
    /// 類名:SessionAdapter
    /// 功能描述:Session封裝	
    public class SessionAdapter : MarshalByRefObject, IDictionary
    {
        private HttpSessionState _session;  private static SessionAdapter _SessionAdapter;

        public static SessionAdapter Session
        {
            get
            {
                if (_SessionAdapter == null)
                {
                    _SessionAdapter= new SessionAdapter();
                }
                return _SessionAdapter;
            }
        }

      
        private SessionAdapter()
        {
            _session = HttpContext.Current.Session;
        }

      
        IDictionaryEnumerator IDictionary.GetEnumerator()
        {
            throw new NotImplementedException();
        }

     
        public ICollection Keys
        {
            get { return _session.Keys; }
        }

      
        public void CopyTo(Array array, int index)
        {
            throw new NotImplementedException();
        }

    
        public int Count
        {
            get { return _session.Count; }
        }

      
        public object SyncRoot
        {
            get { return _session.SyncRoot; }
        }

     
        public bool IsSynchronized
        {
            get { return _session.IsSynchronized; }
        }

   
        public IEnumerator GetEnumerator()
        {
            return _session.GetEnumerator();
        }

     
        public bool Contains(object key)
        {
            return _session[(String)key] != null;
        }

     
        public void Add(object key, object value)
        {
            _session.Add((String)key, value);
        }

     
        public void Clear()
        {
            _session.Clear();
        }

    
        public void Remove(object key)
        {
            _session.Remove((String)key);
        }

       
        public ICollection Values
        {
            get { throw new NotImplementedException(); }
        }

        
        public bool IsReadOnly
        {
            get { return _session.IsReadOnly; }
        }

      
        public bool IsFixedSize
        {
            get { return false; }
        }

      
        public object this[object key]
        {
            get { return _session[(String)key]; }
            set
            {
                _session[(String)key] = value;
            }
        }
    }
}
主站蜘蛛池模板: 托克逊县| 蛟河市| 囊谦县| 卓资县| 德化县| 调兵山市| 珲春市| 淮南市| 庄河市| 梁平县| 余江县| 朝阳区| 柘城县| 满洲里市| 台北县| 二连浩特市| 潼关县| 上杭县| 六枝特区| 二手房| 赤壁市| 阿瓦提县| 漠河县| 霍林郭勒市| 宁津县| 玛沁县| 河北省| 武平县| 信丰县| 新民市| 崇礼县| 饶阳县| 乌鲁木齐市| 泗阳县| 华池县| 榆中县| 双流县| 吉水县| 沙雅县| 石渠县| 瓮安县|