Hashtable h = new Hashtable();
ArrayList arraylist = new ArrayList();
arraylist.Add("chen");
arraylist.Add("1");
h["ping"] = arraylist;
Response.Write(((ArrayList)h["ping"])[0].ToString());
Hashtable h = (Hashtable)Cache["online"];
if (h != null)
{
IDictionaryEnumerator e1 = h.GetEnumerator();
bool flag = false;
while (e1.MoveNext())
{
if ((string)((ArrayList)e1.Value)[0] == name)
{
flag = true;
break;
}
}
if (flag)
{
TimeSpan ts = System.DateTime.Now.Subtract(Convert.ToDateTime(((ArrayList)e1.Value)[1]));
if (ts.TotalSeconds < 60)
throw new MyException("对不起,你输入的账户正在被使用中,如果你是这个账户的真正主人,请在下次登陆时及时的更改你的密码,因为你的密码极有可能被盗窃了!");
else
{
h.Remove(e1.Key);
}
}
}