我已经尝试过使用for
循环,Dictionary
但无法真正实现我想要的。
我有一个特定的变量SomeVariable
,并且我希望我在这个变量的值上foreach
工作。SomeVariable
可1,2,3 or 4
所以可以说SomeVariable
我1
想item.value
从SomeCollection
.
如果我想SomeVariable
从.2
item.value
SomeCollection
等等...
For Each item As KeyValuePair(Of String, Integer) In SomeCollection
If SomeVariable = 1 Then
//....
ElseIf SwitchCount = 2 Then
//....
End If
Next