网友您好, 请在下方输入框内输入要搜索的题目:
( 35 )设在工程文件中有一个标准模块,其中定义了如下记录类型:
Type Books
Name As String * 10
TelNum As String * 20
End Type
在窗体上画一个名为 Command1 的命令按钮,要求当执行事件过程 Command1_Click 时,在顺序文件Person.txt 中写入一条 Books 类型的记录。下列能够完成该操作的事件过程是
A ) Private Sub Command1_Click()
Dim B As Books
Open “ Person.txt ” For Output As #`1
B.Name=InputBox( “ 输入姓名 ” )
B.TelNum=InputBox( “ 输入电话号码 ” )
Write #1,B.Name,B.TelNum
Close #1
End Sub
B ) Private Sub Command1_Click()
Dim B As Books
Open “ Person.txt ” For input As #`1
B.Name=InputBox( “ 输入姓名 ” )
B.TelNum=InputBox( “ 输入电话号码 ” )
Print #1,B.Name,B.TelNum
Close #1
End Sub
C ) Private Sub Command1_Click()
Dim B As Books
Open “ Person.txt ” For Output As #`1
B.Name=InputBox( “ 输入姓名 ” )
B.TelNum=InputBox( “ 输入电话号码 ” )
Write #1,B
Close #1
End Sub
D ) Private Sub Command1_Click()
Open “ Person.txt ” For input As #`1
Name=InputBox( “ 输入姓名 ” )
TelNum=InputBox( “ 输入电话号码 ” )
Print #1, Name, TelNum
Close #1
End Sub
参考答案
更多 “ ( 35 )设在工程文件中有一个标准模块,其中定义了如下记录类型:Type BooksName As String * 10TelNum As String * 20End Type在窗体上画一个名为 Command1 的命令按钮,要求当执行事件过程 Command1_Click 时,在顺序文件Person.txt 中写入一条 Books 类型的记录。下列能够完成该操作的事件过程是A ) Private Sub Command1_Click()Dim B As BooksOpen “ Person.txt ” For Output As #`1B.Name=InputBox( “ 输入姓名 ” )B.TelNum=InputBox( “ 输入电话号码 ” )Write #1,B.Name,B.TelNumClose #1End SubB ) Private Sub Command1_Click()Dim B As BooksOpen “ Person.txt ” For input As #`1B.Name=InputBox( “ 输入姓名 ” )B.TelNum=InputBox( “ 输入电话号码 ” )Print #1,B.Name,B.TelNumClose #1End SubC ) Private Sub Command1_Click()Dim B As BooksOpen “ Person.txt ” For Output As #`1B.Name=InputBox( “ 输入姓名 ” )B.TelNum=InputBox( “ 输入电话号码 ” )Write #1,BClose #1End SubD ) Private Sub Command1_Click()Open “ Person.txt ” For input As #`1Name=InputBox( “ 输入姓名 ” )TelNum=InputBox( “ 输入电话号码 ” )Print #1, Name, TelNumClose #1End Sub ” 相关考题
![瑞牛题库 章节练习 历年真题 模拟试卷](http://assets.51tk.com/51_sidebar_right_index.jpg)