vb高手来帮帮忙啊

来源:百度知道 编辑:UC知道 时间:2024/06/14 11:22:48
单击“统计”按钮 则自动统计in5.dat文件中所含字母(不区分大小写)出现的次数,并将出现次数最多的字母显示在text1文本框内,它所出现的次数显示在text2文本框内。请高手帮忙为“统计”按钮编写适当的事件过程实现上述功能
这里有详细的,,请问??处的编程

Private Sub Command1_Click()
Dim s As String
CommonDialog1.Filter = "所有文件|*.*|文本文件|*.txt"
CommonDialog1.FilterIndex = 2
On Error GoTo openerr
CommonDialog1.InitDir = App.Path
CommonDialog1.ShowOpen
Open CommonDialog1.FileName For Input As #1
Input #1, s
Close #1
Text1.Text = s
openerr:
End Sub

Private Sub Command2_Click()
'????
End Sub

Private Sub Command3_Click()
CommonDialog1.Filter = "文本文件|*.txt|所有文件|*.*"
CommonDialog1.FilterIndex = 1
On Error GoTo openerr
CommonDialog1.FileName = "out5.txt"
CommonDialog1.InitDir = App.Path
CommonDialog1.Action = 2
Open CommonDialog1.FileName For Output As #1
Print #1, T

VERSION 5.00
Begin VB.Form Form1
BorderStyle = 3 'Fixed Dialog
Caption = "Form1"
ClientHeight = 2745
ClientLeft = 45
ClientTop = 435
ClientWidth = 4260
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2745
ScaleWidth = 4260
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 510
Left = 1665
TabIndex = 2
Top = 1845
Width = 1275
End
Begin VB.TextBox Text2
Height = 285
Left = 1980
TabIndex = 1
Top = 1215