有没有办法在VB.NET中做同样的事情?
Dictionary<int, string> myDict = new Dictionary<int, string>()
{
{ 2, "This" },
{ 1, "is" },
{ 5, "radio" },
{ 12, "clash" },
};
答案 0 :(得分:9)
如上面Marcel的评论所述:
Dim myDict As New Dictionary(Of Integer, String) From _
{{1, "one"}, {2, "two"}, {3, "three"}}