问题 单项选择题

设在工程中有一个标准模块,其中定义了如下类型:
Type stutype
ino As Integer
strname As String*20
strsex As String*1
smark As Single
End Type
在窗体上画一个名为Connnand1的命令按钮,要求当执行事件过程Command1_Click时,在c:\的随机文件student..dat写入一条记录。下列能够完成该操作的事件过程是( )。

A.Sub Command1_C1ick()
Dim student As studtype
Dim record_no As Integer
record_no=1
With student
.ino=12
.strname="smith"
.strsex="男"
.smark=89
End With
Open" c:\student.dat" For input As # 1 len=len(student)
Put # 1,record_no,student
Close #1
End Sub
B.Sub Command1_Click( )
Dim student As studtype
Dim record_no As Integer
record_no=1
With student
.ino=12
.strname="smith"
.strsex="男"
.smark=89
End With
Open"c:\student.dat" For random As #1 len=len(student)
Put #1,record_no,student
Close #1
End Sub
C.Sub Command1_Click()
Dim student As studtype
Dim record_no As integer
record_no=1
With student
.ino=12
.stmame="smith"
.strsex="男"
.smark=89
End With
Open"c:\student.dat" For random As #1 len=len(student)
Write #1,record_no,student
Close #1
End Sub
D.Sub Command1_Click()
Dim Student As studtype
Dim Record_no As Integer
record_no=1
With student
.ino=12
.strname="smith"
.strsex="男"
.smark=89
End With
Open"c:\student.dat"For output As #1 len=len(student)
Put #1,record_no,student
Close #1
End #1

答案

参考答案:B

材料分析题
多项选择题