题目内容:
在窗体上有两个名称分别为Text1、Text2的文本框,一个名称为Co mmand1的命令按钮,运行后的窗体外观如图所示: 
设有如下的类型和变量声明:
Private Type Person
name As STRING*8
major As Stri ng*20
End Type
Di mp As Person
设文本框中的数据已正确地赋值给Person 类型的变量p ,当点击"保存"按钮时,能够正确地把变量中的数据写入随机文件Test2.dat 中的程序段是( )。 A.Open "c :\Test2.dat"For Output As #1
Put #1,1,p
Close #1
B.Open "c :\Test2.dat"For Rando m As #1
Get #1,1,p
Close #1
C.Open "c :\Test2.dat"For Rando m As #1Len =Len
(p)Put #1,1,p
Close #1
D.Open "c :\Test2.dat"For Rando m As #1Len =Len
(p)Get #1,1,p
Close #1
参考答案:
答案解析: