当前位置: 首页>>代码示例>>C#>>正文


C# HttpSessionStateBase.Remove方法代码示例

本文整理汇总了C#中System.Web.HttpSessionStateBase.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# HttpSessionStateBase.Remove方法的具体用法?C# HttpSessionStateBase.Remove怎么用?C# HttpSessionStateBase.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.HttpSessionStateBase的用法示例。


在下文中一共展示了HttpSessionStateBase.Remove方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RemoveImagesFromSession

 public void RemoveImagesFromSession(HttpSessionStateBase session)
 {
     int userId = sessionManager.GetUser().UserId;
     string sesKey = Globals.SESSIONKEY_UPLOADED_PHOTOS + userId.ToString();
     if (session[sesKey] != null)
     {
         session.Remove(sesKey);
     }
 }
开发者ID:htien,项目名称:nsn,代码行数:9,代码来源:FrontendService.cs

示例2: ClearSession

 /// <summary>
 /// Clear the maestrano session
 /// </summary>
 /// <param name="httpSessionObj"></param>
 public void ClearSession(HttpSessionStateBase httpSessionObj)
 {
     httpSessionObj.Remove("maestrano");
 }
开发者ID:benjineering,项目名称:maestrano-dotnet,代码行数:8,代码来源:Sso.cs

示例3: RemoveImagesFromDisk

 public void RemoveImagesFromDisk(HttpSessionStateBase session)
 {
     int userId = sessionManager.GetUser().UserId;
     string sesKey = Globals.SESSIONKEY_UPLOADED_PHOTOS + userId.ToString();
     if (session[sesKey] == null)
     {
         return;
     }
     IList<ImageInfo> images = session[sesKey] as IList<ImageInfo>;
     foreach (ImageInfo image in images)
     {
         try
         {
             System.IO.File.Delete(image.LinkAccess);
         }
         catch
         {
             continue;
         }
     }
     session.Remove(sesKey);
 }
开发者ID:htien,项目名称:nsn,代码行数:22,代码来源:FrontendService.cs

示例4: ClearSession

 /// <summary>
 /// Clear the maestrano session
 /// </summary>
 /// <param name="httpSessionObj"></param>
 public void ClearSession(HttpSessionStateBase httpSessionObj)
 {
     httpSessionObj.Remove(presetName);
 }
开发者ID:CamilleCrespeau,项目名称:maestrano-dotnet,代码行数:8,代码来源:Sso.cs

示例5: ClearCart

        protected void ClearCart(HttpSessionStateBase session)
        {
            session.Remove("cartCount");

        }
开发者ID:mukhtiarlander,项目名称:git_demo_torit,代码行数:5,代码来源:BaseController.cs

示例6: Remove

 /// <summary>
 /// Remove
 /// </summary>
 /// <param name="context"></param>
 /// <param name="sessionState"></param>
 public static void Remove(HttpSessionStateBase sessionState, string sessionKey)
 {
     sessionState.Remove(sessionKey);
 }
开发者ID:vuchannguyen,项目名称:lg-py,代码行数:9,代码来源:SessionManager.cs

示例7: Logout

        /// <summary>
        ///     Attempts to logout a user.
        /// </summary>
        /// <param name="session">The user's session.</param>
        /// <returns>true if logout was successful, false otherwise.</returns>
        /// <exception cref="System.ArgumentNullException">Thrown when session is null.</exception>
        public bool Logout(HttpSessionStateBase session)
        {
            // Sanitize
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }

            // Get object from session
            object result = session[_sessionLoggedInKey];
            // Check if we found something
            if (result == null)
            {
                // Nope
                return false;
            }

            // Log 'em out
            session.Remove(_sessionLoggedInKey);
            return true;
        }
开发者ID:TS-Johns,项目名称:k94warriors,代码行数:27,代码来源:LoginHandler.cs


注:本文中的System.Web.HttpSessionStateBase.Remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。