我为 HttpContext.Current.Session
添加了一个监视表达式
我可以看到 Count 等于 2,但我找不到实际内容。调试时在哪里可以找到 session 的内容?
最佳答案
您需要对特定项目设置监视,例如:
HttpContext.Current.Session["YourKey1"]
// or
HttpContext.Current.Session["YourKey2"]
您还可以查询 Count
,它是 session 集合中的项目数:
HttpContext.Current.Session.Count
如果您想查看所有Key
,您可以执行以下操作:
string someKey = HttpContext.Current.Session.Keys[indexOfKeyYouWant];
关于asp.net - 调试时观察 session 内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5084228/