using System.Web; namespace Ant.Service.Utilities { //public static class SessionHelper2 //{ // /// // /// 添加Session,调动有效期为20分钟 // /// // /// Session对象名称 // /// Session值 // public static void Add(string strSessionName, string strValue) // { // HttpContext.Current.Session[strSessionName] = strValue; // HttpContext.Current.Session.Timeout = 20; // } // /// // /// 添加Session,调动有效期为20分钟 // /// // /// Session对象名称 // /// Session值数组 // public static void Adds(string strSessionName, string[] strValues) // { // HttpContext.Current.Session[strSessionName] = strValues; // HttpContext.Current.Session.Timeout = 20; // } // /// // /// 添加Session // /// // /// Session对象名称 // /// Session值 // /// 调动有效期(分钟) // public static void Add(string strSessionName, string strValue, int iExpires) // { // HttpContext.Current.Session[strSessionName] = strValue; // HttpContext.Current.Session.Timeout = iExpires; // } // /// // /// 添加Session // /// // /// Session对象名称 // /// Session值数组 // /// 调动有效期(分钟) // public static void Adds(string strSessionName, string[] strValues, int iExpires) // { // HttpContext.Current.Session[strSessionName] = strValues; // HttpContext.Current.Session.Timeout = iExpires; // } // /// // /// 读取某个Session对象值 // /// // /// Session对象名称 // /// Session对象值 // public static string Get(string strSessionName) // { // if (HttpContext.Current.Session[strSessionName] == null) // { // return null; // } // else // { // return HttpContext.Current.Session[strSessionName].ToString(); // } // } // /// // /// 读取某个Session对象值数组 // /// // /// Session对象名称 // /// Session对象值数组 // public static string[] Gets(string strSessionName) // { // if (HttpContext.Current.Session[strSessionName] == null) // { // return null; // } // else // { // return (string[])HttpContext.Current.Session[strSessionName]; // } // } // /// // /// 删除某个Session对象 // /// // /// Session对象名称 // public static void Del(string strSessionName) // { // HttpContext.Current.Session[strSessionName] = null; // } //} }