我认为今天非常容易。在C#中,其:
Dictionary<String, String> dict = new Dictionary<string, string>() { { "", "" } };
但是在vb中,以下操作无效。
Public dict As Dictionary(Of String, String) = New Dictionary(Of String, String) (("",""))
我很确定有一种在声明时添加它们的方法,但是我不确定如何添加。是的,我想在声明时(而不是其他时间)添加它们。:)所以希望这是可能的。谢谢大家。
我也尝试过:
Public dict As Dictionary(Of String, String) = New Dictionary(Of String, String) ({"",""})
和...
Public dict As Dictionary(Of String, String) = New Dictionary(Of String, String) {("","")}
和...
Public dict As Dictionary(Of String, String) = New Dictionary(Of String, String) {{"",""}}