单选题 VB
题号 #144444

假定在工程文件中有一个标准模块,其中定义了如下记录类型  
Type Books  
 Name As String * 10  
 TelNum As String * 20  
End Type  
要求当执行事件过程Command1_Click时,在顺序文件Person.txt中写入一条记录。下列能够完成该操作的事件过程是(  )。
A.Private Sub Command1_Click()  
  Dim B As Books  
  Open "c:\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 "c:\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 "c:\Person.txt" For Output As #1  
    Name = InputBox("输入姓名")  
    TelNum = InputBox("输入电话号码")  
   Write #1, B  
   Close #1 
  End Sub  
D.Private Sub Command1_Click()  
  Dim B As Book  
  Open "c:\Person.txt" For Input As #1  
   Name = InputBox("输入姓名")  
   TelNum = InputBox("输入电话号码")  
  Print #1, B.Name, B.TelNum  
  Close #1  
 End Sub 

进入在线模考

参考答案

A

答案解析

暂无解析

你可能感兴趣的试题

A.显示当前驱动器或指定驱动器上的某目录下的文件名  
B.显示当前驱动器或指定驱动器上的目录结构  
C.显示根目录下的文件名  
D.显示指定路径下的文件
找试题 · 找答案 · 找资料 在线模考