【单选题】窗体上有两个名称分别为Text1、Text2的文本框,一个名称为Command1的命令按钮。设有如下的类型声明: Type Person name As String*8 major As String*20 End Type 当单击“Command1”按钮时,能够正确地把数据写入文件的程序段是______。
A.
Private Sub Command1_Click() Dim p As Person p. name=Text1. Text p. major=Text2. Text Open'C:/data. dat' For Random As #1 Put #1, 1, p Close #1 End Sub
B.
Private Sub Command1_Click() Dim p As Person p. name=Text1.Text p. major=Text2. Text Open'C:/data. dat' For Random As #1 Get #1, 1, p Close #1 End Sub
C.
Private Sub Command1_Click() Dis p As Person p. name=Text1. Text p. major=Text2. Text open 'C:/data. dat' For Random As #1 Len=Len(p) Put #1, 1, p Close #1 End Sub
D.
Private Sub Command1_Click() Dim p As Person p. name=Text1. Text p. major=Text2. Text Open 'C:/data. dat' For Random As #1=Len(p) Get #1, 1, p Close #1 End Sub