RTB.Clear()
OPD.Filter = "Text files (*.txt)|*.txt"
OPD.ShowDialog()
Dim filepath As String = OPD.FileName
If Not System.IO.File.Exists(filepath) Then
Exit Sub
Else
Dim fileStream As New FileStream(filepath, FileMode.Open, FileAccess.Read)
Dim readerStream As New StreamReader(fileStream)
Dim letter(25) As Integer
Dim strText As String
Dim current As Integer
Dim intLoopStrText, intLoopLetter As Integer
Try
strText = readerStream.ReadToEnd
strText = strText.ToUpper
While (intLoopStrText < strText.Length)
current = Asc(strText.Substring(intLoopStrText, 1))
If current >= 65 And current <= 90 Then
letter(current - 65) += 1
End If
intLoopStrText += 1
End While
For intLoopLetter = 0 To 25
RTB.Text &= Chr(65 + intLoopLetter) & "=" & letter(intLoopLetter) & vbCrLf
Next
readerStream.Close()
Catch ex As IOException
MsgBox(ex.Message)
End Try