⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 logout.cs

📁 ASP.NET简洁论坛源代码 这是一个简单的论坛
💻 CS
字号:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.Security;
using NetFocus.Web.Core;

namespace NetFocus.Web.Applications.Forum
{
    [ParseChildren(true)]
    public class Logout : UserControl
    {
        protected override void OnLoad(EventArgs e)
        {
            if (Context.Request.IsAuthenticated)
            {
                FormsAuthentication.SignOut();
                HttpCookie formsAuthCookie = FormsAuthentication.GetAuthCookie(WebContext.Current.User.UserName, true);
                UserCookie.DeleteCookie(formsAuthCookie);

                //NetFocus.Web.Components.Roles.SignOut();
            }

            Context.Response.Redirect(SiteUrls.Instance().Home, true);
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -