Imports System
Imports System.Linq
Imports System.Collections.Generic
Public Class Program
Public Shared Sub Main(ByVal args As String())
Dim dic As Dictionary(Of String, Integer) = New Dictionary(Of String, Integer)()
dic.Add("c#", 99)
dic.Add("php", 44)
dic.Add("c++", 888)
dic.Add("java", 1)
Dim sortedDic = From entry In dic Order By entry.Value Select entry
For Each keyval As KeyValuePair(Of String, Integer) In sortedDic
Console.WriteLine("Key = {0}, Value = {1}", keyval.Key, keyval.Value)
Next
End Sub
End Class
' run:
'
' Key = java, Value = 1
' Key = php, Value = 44
' Key = c#, Value = 99
' Key = c++, Value = 888
'