public System.Collections.Hashtable HashData
{
get
{
if (IsPostBack)
{
System.Collections.Hashtable hash = new System.Collections.Hashtable();
hash.Add("changeqkcs", changeqkcs.Value);
hash.Add("deleteqkid", deleteqkid.Value);
return hash;
}
else
{
return null;
}
}
}
DataOperate.SessionHash =HashData;//存值。//应该怎么样取值呢?
Hashtable h= new Hashtable (); foreach (DictionaryEntry d in h)
{
Console.WriteLine(d.Key + " " + d.Value);
}
Session[""] as Hashtable
public static System.Collections.Hashtable SessionHash
{
set
{
SessionState.Set("hashchange", value);
}
get
{
object o = SessionState.Get("hashchange");
if (o != null)
{
return (System.Collections.Hashtable)o;
}
else
{ return null; }
}
}
ht.Add(0, "A");
Session["abc"] = ht;
Hashtable hs = (Session["abc"] as Hashtable);
string ss =hs[0].ToString();