VB 用 Shell " explorer " 打开.dat 结尾的文件,总是无效的过程调用或函数, 问题在哪
标准模块:Type pinfo
name As String * 4
age As Integer
addr As String * 10
End Type
窗体模块
Option Base 1(声明)
Private Sub Form_Click()
Static a() As pinfo
Open App.Path & "\p_list.dat" For Append As #1
n = InputBox("请问你要输入几个人的信息?")
ReDim a(n) As pinfo
For i = 1 To n
a(i).name = InputBox("请输入姓名")
a(i).age = InputBox("请输入年龄")
a(i).addr = InputBox("请输入所在地区")
Write #1, a(i).name, a(i).age, a(i).addr
Next
Close #1
b = MsgBox("文件写入完毕是否查看该文件?", vbYesNo + vbQuestion)
If b = vbYes Then
Shell " explore " & App.Path & "\p_list.dat"
End If
End Sub