单选题
在窗体上有两个名称分别为Text1、Text2的文本框,一个名称为Command1的命令按钮,运行后的窗体外观如图所示:
A、
Open "c:/Test2.dat" For Output As #1Put #1, 1, pClose #1
B、
Open "c:/Test2.dat" For Random As #1Get #1,1,pColse #1
C、
Open "c:/Text2.dat" For Random As #1 Len=Len(p)Put #1,1,pClose #1
D、
Open "c:/Test2.dat" For Random As #1 Len=Len(p)Get #1,1,pClose #1
【正确答案】
C
【答案解析】
[解析] 此题考查随机文件。要向随机文件中写入数据,首先这个文件必须是以Random方式打开的,并且后面必须有随机文件的长度,另外,向随机文件中写文件使用的是Put,所以此题选C。
提交答案
关闭