现在global.aspx.cs文件的Application_onstart里面书写:
string[] usr_name=new string[10];
int usr_count=0;
Application["UserName"]=usr_name;
Application["UserCount"]=usr_count;然后再Session_onstart里面:
Application["UserCount"]=(int)Application["UserCount"]+1;
string[] usr_name=(string[])Application["UserName"];
usr_name[(int)Application["UserCount"]]=(string)Session["User_Name"];
在Session_onend里:
Application["UserCount"]=(int)Application["UserCount"]-1;
string[] usr_name=(string[])Application["UserName"];
usr_name[usr_name.Length-1]=String.Empty;然后用循环读出Application["UserCount"]中的值