can anyone pls help me convert this to vb.net
for each (DictionaryEntry<String, Int64> entry in characterCounter)
{
textBox1.Text += String.Format("char {0} occurs {1} times", entry.Key, entry.Value);
}
开发者_StackOverflow中文版
most of the free/online converter throw errors
Try here: http://www.developerfusion.com/tools/convert/csharp-to-vb/
Of course this site assumes that you have valid C# code which is not your case. There is not such operator for each
in C#. Also the DictionaryEntry class is not generic. Here's the automatic translation:
For Each entry As DictionaryEntry In characterCounter
textBox1.Text += [String].Format("char {0} occurs {1} times", entry.Key, entry.Value)
Next
For Each entry As DictionaryEntry In characterCounter
textBox1.Text += String.Format("char {0} occurs {1} times", entry.Key, entry.Value)
Next
For Each entry As KeyValuePair(Of [String], Int64) In characterCounter
txtSummary.Text += String.Format("char {0} occurs {1} times", entry.Key, entry.Value)
Next
For Each entry As DictionaryEntry In characterCounter
textBox1.Text += String.Format("char {0} occurs {1} times", entry.Key, entry.Value)
Next
You can also try this online tool for converting c# to vb.net here: C# to VB
精彩评论