【Visual Basic代码】
Private Sub Drivel_Change()
Dirl.Path= (1) ’户选择的驱动器反映到目录列表框中
End Sub
Private Sub Dirl_Change()
Filel.Path= (2) ’用户选择的文件夹改变文件列表框内容
End Sub
Private Sub sum_Click()
Dim (3) As New FileSystemOject, (4) As TextStxeam
’创建自己的文件系统对象,说明自己的文本流对象
If Right (Dirl.Path,1)="\"Then
SetmyTextFile=fso.OpenTextFile (Dirl.Path+Filel.FileNamc)
Else
SetmyTextFile=fso.OpenTextFile(Dirl.Path+”\’+Filel.FileName)
End“
S=0
Do
d=Val (myTextFilE.ReadRow)
S=S+d
Loop While (5)
Textl.Text=Str$(S)
End Sub