如何计算httpcontext.current.session(" idticket")。add(id_ticket) [英] How can I count a httpcontext.current.session("idticket").add(id_ticket)
本文介绍了如何计算httpcontext.current.session(" idticket")。add(id_ticket)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我用于每个元素......但元素就像一个对象,实际上应该是string.Can任何人都可以帮助我,我怎样才能计算出它的条件?
我尝试了什么:
尝试每个元素
I use for each element... but element come like a object, where in fact should be string.Can any one help me, how can i make a condition to count it??
What I have tried:
try for each element
HttpContext.Current.Session("idTicket")
推荐答案
不确定您需要解决的问题究竟是什么,但此代码应计算项目数在您上面发布的集合中:
Not sure what exactly the problem is that you need to get solved but this code should count the items in the collection that you posted above:
Dim Count As Integer = 0
For Each item As Object In HttpContext.Current.Session("idTicket")
Count = Count + 1
Next
Debug.WriteLine(Count)
For Each ... Next Statement(Visual Basic)| Microsoft Docs [ ^ ]
这篇关于如何计算httpcontext.current.session(" idticket")。add(id_ticket)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文