字典数组列表

2 vb.net dictionary list multidimensional-array webmethod

碰壁了,在文档中找不到太多内容。

我有两本词典,我想把它们放在一个列表中。

Dim listOfDictionaries As List(Of Dictionary(Of String, String))
Run Code Online (Sandbox Code Playgroud)

不管用。

我是否正确地假设一旦我变暗,我就可以添加传统的方式?

详细信息(编辑)

当尝试 listOfDictionaries.Add(dictionaryIWantToAdd) 时,我得到“‘一维数组 system.collection.generic.dictionary(of string, string)’类型的值无法转换为‘system.collection.generic.dictionary(of string) , 细绳)'

解决方案

有助于将 () 放在数组末尾。:P

Tim*_*ter 5

常规的方式是:

Dim both = New List(Of Dictionary(Of String, String))()
both.Add(Dictionary1)
both.Add(Dictionary2)
Run Code Online (Sandbox Code Playgroud)