`

在类中用 Session& 清空session

    博客分类:
  • C#
阅读更多
在类中用 Session

  public class Member : System.Web.UI.Page

让它继承System.Web.UI.Page类就可以了。

转自:http://hi.baidu.com/wptad/blog/item/a1b7ab77f887ce13b051b9bd.html

//退出登陆清空session
// args为你要清空的session对象
Object object = request.getSession().getAttribute(args);
  if (object != null) {
   try {
    request.getSession().removeAttribute(args);
   } catch (Exception e) {
    object = null;
   }
  } 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics