我使用followign對象在我的asp.net頁面使用asp.net中靜態對象的
private static Dictionary<string, List<Guid>> OpenNodes = new Dictionary<string, List<Guid>>();
//Page start
if(!OpenNodes.ContainsKey(Session.SessionID))
{
List<Guid> list = new List<Guid>();
OpenNodes.Add(Session.SessionID, list);
}
//User clicked on a node
Guid id = new Guid(e.Node.Value);
tmpList = OpenNodes[Session.SessionID];
tmpList.Add(id);
OpenNodes[Session.SessionID] = tmpList;
是它。一個好的實踐的研究還是有一個類似的「好」的方式來達到同樣的?
我想念鎖......無論是鎖(/ ** /)'或'ReaderWriterLockSlim' - 使用 – 2010-02-05 10:19:07