设在工程中有一个标准模块,其中定义了如下记录类型:
Type Books
Name As String * 10
TelNum As String * 20
EndType
在窗体中添加一个名为Commandl的命令按钮,要求单击命令按钮时,在顺序文件 P1. txt中写入一条记录。下列能够完成该操作的程序段是 ( )
A) Private Sub Commandl_Click()
Dim B As Books
Open"d:\P1.txt"For Output As
#1
B. Name=InputBox( "姓名")
B. TelNum=InputBox("电话号码")
Write #1,B. Name,B. TelNum
Close #1
EndSub
B) Private Sub Commandl_Click()
Dim B As Books
Open" d:\Pl.txt" For Input As
B. Name=InputBox ("姓名")
B. TelNum=InputBox ("电话号码")
Print #1,B. Name,B. TelNum
Close #1
EndSub
C) Private Sub Commandl_Click()
Dim B As Books
Open"d:\P1. txt"For Output As
B. Name=InputBox("姓名")
B. TelNum=InputBox ("电话号码")
Write #1,B
Close #1
EndSub
D) Private Sub Commandl Cliek()
Open"d:\P1.txt" For Input As
Name=InputBox("姓名")
TelNum=InputBox ("电话号码")
Print #1,Name,TelNum
Close #1
EndSub