本文整理汇总了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);
}
示例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();
}
示例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);
}
}
}