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


C# Util.Logout方法代码示例

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


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

示例1: LogoutButton_Click

 protected void LogoutButton_Click(object sender, ImageClickEventArgs e)
 {
     Util util = new Util();
     Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
     if (util.CheckSessionTimeout(State, Response, "Default.aspx")) return;
     string account_type = util.GetAccountType(State);
     util.Logout(State);
     if (account_type != null && account_type.Contains("google_apps"))
         Response.Redirect("../LogoutForGoogleApps.aspx", false);
     else
         Response.Redirect("../Default.aspx", false);
 }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:12,代码来源:AppBrandingBilling.aspx.cs

示例2: CopyTemplateAppToAccount_Click

    protected void CopyTemplateAppToAccount_Click(object sender, EventArgs e)
    {
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (util.CheckSessionTimeout(State, Response, "Default.aspx")) return;

        if (State == null) return;
        if (State["CustomerID"] == null) // check for lost or end of Session
        {
            util.Logout(State);
            return;
        }
        string selected_template =  State["SelectedTemplateApp"].ToString();
        util.CopyTemplateApp(State, selected_template,  State["NameForTemplateApp"].ToString());
        LoadData();
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:16,代码来源:TabMySolutions.aspx.cs

示例3: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (State == null)
        {
            return;
        }
        else if (State["PreviousError"] != null)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), "alert('" + State["PreviousError"].ToString() + "');", true);
            State.Remove("PreviousError");
        }

           ClientScriptManager CSM = Page.ClientScript;
        State["ClientScriptManager"] = CSM;

        if (Request == null || Request.ServerVariables == null)
            return;

        State["PageRequestIPAddress"] = Request.ServerVariables["REMOTE_ADDR"]; //used if user logs in again after quitting

        string gapps_email = Context.Request.QueryString.Get("gapps_email");
        if (State["LoggedInFromAdmin"] != null ||
              State["LoggedinFromEula"] != null ||
             State["LoggedInFromGoogleApps"] != null ||
            gapps_email != null)
        {
            if (gapps_email != null)
            {
                State["Username"] = gapps_email;
                State["LoggedInFromGoogleApps"] = gapps_email;
            }
            State["LoggedInFromAdmin"] = null;
            State["LoggedinFromEula"] = null;
            ViziAppsLogin_Click(null, null);
            return;
        }

        try
        {
            util.LogLastUsed(State);
            if (Request.Form.Get("Logout") != null) // check if user is logged out
            {
                //log out is actually done twice: once from the server and once from the client posting to the server
                //the second time around we throw an exception with the message "logged out"
                util.Logout(State);
                throw new Exception("logged out");
            }

        }
        catch (Exception ex)
        {
            util.LogError(State, ex);
            if (ex.Message.IndexOf("incorrect") >= 0)
            {
                util.Logout(State);
                FailureText.Text = ex.Message;
            }
            else if (ex.Message.IndexOf("timed out") >= 0)
            {
                util.Logout(State);
                FailureText.Text = "Your session has timed out.";
            }
            else if (ex.Message.IndexOf("in use") >= 0)
            {
                util.Logout(State);
                FailureText.Text = "Your account is already in use.";
            }
            else
            {
                util.ProcessMainExceptions(State, Response, ex);
            }
        }
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:75,代码来源:Default.aspx.cs


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