淺談asp.net簡(jiǎn)單實(shí)現(xiàn)注銷功能

2016-09-02    分類: 網(wǎng)站建設(shè)

以下內(nèi)容主要是給大家分析一下asp.net中,如何簡(jiǎn)單的實(shí)現(xiàn)注銷功能,希望有需要的朋友可以關(guān)注一下的哦!

1.Web窗體:index.aspx

注銷

2.一般處理程序:LogoutHandler.ashx

///

/// LogoutHandler 的摘要說(shuō)明

///

public class LogoutHandler : IHttpHandler,IRequiresSessionState

{

 public void ProcessRequest(HttpContext context)

 {

   context.Session.Clear();  //從會(huì)話狀態(tài)集合中移除所有的鍵和值

   context.Session.Abandon(); //取消當(dāng)前會(huì)話

   context.Response.Redirect("/account/login.aspx");  //跳轉(zhuǎn)登錄頁(yè)

 }

 public bool IsReusable

 {

   get

   {

     return false;

   }

 }

}

網(wǎng)站標(biāo)題:淺談asp.net簡(jiǎn)單實(shí)現(xiàn)注銷功能
鏈接分享:http://www.muchs.cn/news27/44577.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計(jì)公司、Google、網(wǎng)站設(shè)計(jì)響應(yīng)式網(wǎng)站、品牌網(wǎng)站建設(shè)移動(dòng)網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

網(wǎng)站建設(shè)網(wǎng)站維護(hù)公司