本文整理汇总了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);
}
}
示例2: ClearSession
/// <summary>
/// Clear the maestrano session
/// </summary>
/// <param name="httpSessionObj"></param>
public void ClearSession(HttpSessionStateBase httpSessionObj)
{
httpSessionObj.Remove("maestrano");
}
示例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);
}
示例4: ClearSession
/// <summary>
/// Clear the maestrano session
/// </summary>
/// <param name="httpSessionObj"></param>
public void ClearSession(HttpSessionStateBase httpSessionObj)
{
httpSessionObj.Remove(presetName);
}
示例5: ClearCart
protected void ClearCart(HttpSessionStateBase session)
{
session.Remove("cartCount");
}
示例6: Remove
/// <summary>
/// Remove
/// </summary>
/// <param name="context"></param>
/// <param name="sessionState"></param>
public static void Remove(HttpSessionStateBase sessionState, string sessionKey)
{
sessionState.Remove(sessionKey);
}
示例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;
}