资讯   |   开发   |   选机中心   |   产品大全 | IBM | 惠普 | 联想 | 戴尔 | 苹果 | 神舟
更多: | 华硕 | 明基 | 方正 | 紫光 | TCL | 夏新 | 联宝 | 宏碁 | 七喜 | 长城 | 清华同方 | 海尔 | 三星 | 东芝 | 索尼 | 富士通 | LG | 技术 | ddnoon
当前位置:笔记本 > 软件开发 >
Advertisement
文章正文

如何获得页面所有Session信息

类型:转载   责任编辑:asp.net   日期:2007/05/23


热门软件下载:


   

由于在很多不同的页创建了session对象,到最后自己也记不清有哪些session。所以,有没有什么办法可以获得所有session信息。这样我就可以清空session,不影响其它的页。

网友回答:

发表者:Mypiger

//   Clear   the   contents   of   their   session  
  HttpContext.Current.Session.Clear();  
  //   Tell   the   system   to   drop   the   session   reference   so   that   it   does    
  //   not   need   to   be   carried   around   with   the   user  
  HttpContext.Current.Session.Abandon();

发表者:chnama

for(int   i   =   0;i   <   Session.Count;i++)  
  {  
  ShowMessage(Session[i].ToString());  
  }

发表者:cocoguo

int   n=Session.Count;  
  for(int   i=0;i<n;i++)  
  Response.Write("<script>window.alert("+Session[i].ToString()+")</script>");  
 


 

 
热门推荐笔记本: TCL笔记本
相关文章:
webmaster:popbb@126.com   最佳浏览:1024X768 MSIE
©2007 popbb.net All Rights Reserved