當前位置: 首頁>>代碼示例>>C#>>正文


C# HttpSessionState.Abandon方法代碼示例

本文整理匯總了C#中System.Web.SessionState.HttpSessionState.Abandon方法的典型用法代碼示例。如果您正苦於以下問題:C# HttpSessionState.Abandon方法的具體用法?C# HttpSessionState.Abandon怎麽用?C# HttpSessionState.Abandon使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Web.SessionState.HttpSessionState的用法示例。


在下文中一共展示了HttpSessionState.Abandon方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SignOut

        public void SignOut(HttpResponse response, HttpSessionState sessionState)
        {
            var user = GetUser(false);
            Logger.Log.Error(string.Format("User {0} sing out.", user.UserName));

            response.Cache.SetCacheability(HttpCacheability.NoCache);
            response.Cache.SetExpires(DateTime.Now);

            FormsAuthentication.SignOut();
            sessionState.Abandon();

            response.Redirect(@"~/Index.aspx");
            response.End();
        }
開發者ID:SergeyKotyushkin,項目名稱:StoreSolution,代碼行數:14,代碼來源:UserGroup.cs

示例2: checkSysConfirm

 public static bool checkSysConfirm(HttpSessionState session, HttpResponse response)
 {
     if (session["sysConfirm"] == null || !((bool)session["sysConfirm"]))
     {
         session.Abandon();
         StringBuilder sbScriptStr = new StringBuilder();
         sbScriptStr.Append("<script language=\"javascript\">\n");
         sbScriptStr.Append("alert(\"登錄信息丟失,請重新登錄\");\n");
         sbScriptStr.Append("if(typeof(window.top.dialogArguments) != \"undefined\"){\n");
         sbScriptStr.Append("window.top.dialogArguments.top.location.href=\"../ReLoad.aspx\";\n");
         sbScriptStr.Append("window.top.close();\n");
         sbScriptStr.Append("}else if(window.top.opener != \"undefined\" && window.top.opener.closed==false){\n");
         sbScriptStr.Append("window.top.opener.top.location.href=\"../ReLoad.aspx\";\n");
         sbScriptStr.Append("window.top.close();\n");
         sbScriptStr.Append("}else{\n");
         sbScriptStr.Append("window.top.location.href=\"../ReLoad.aspx\";\n");
         sbScriptStr.Append("}\n");
         sbScriptStr.Append("</script>\n");
         response.Write(sbScriptStr.ToString());
         response.End();
         return false;
     }
     return true;
 }
開發者ID:jongking,項目名稱:XueXiaoWeiXin,代碼行數:24,代碼來源:MyDocumentCheckConfirm.cs

示例3: clearSession

 private void clearSession(HttpSessionState userSession)
 {
     string userName = (string)userSession[DatabaseUserSecurityAuthority.IGMADAM_USERNAME];
     userSession.Abandon();
     userSession.Clear();
     userSession[SESSIONMEMBER_DISCONNECTED] = true;
     userSession[SESSIONMEMBER_RELOADPAGE] = true;
     if (userName != null)
         AppendInfo("User " + userName + " has been disconnected");
     FormsAuthentication.SignOut();
 }
開發者ID:JBetser,項目名稱:Imagenius_SDK,代碼行數:11,代碼來源:IGPEMultiplexing.cs

示例4: Borrar

 /// <summary>
 /// Elimina la sesión de usuario
 /// </summary>
 /// <param name="sesion"></param>
 public static void Borrar(HttpSessionState sesion)
 {
     sesion.Abandon();
 }
開發者ID:jotacero,項目名稱:ligotea,代碼行數:8,代碼來源:LRegistro.cs


注:本文中的System.Web.SessionState.HttpSessionState.Abandon方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。