题目内容:
窗体上有1个名称为Text1的文本框和1个名称为Co mmand1.的命令按钮。要求程序运行时,单击命令按钮,就可把文本框中的内容写到文件out .txt 中,每次写入的内容附加到文件原有内容之后。下列能够正确实现以上功能的程序是( )。
A.Private Sub Co mmand1_Click()Open "out .txt"For Input As #1
Print #1,Text1.Text
Close #1
End Sub
B.Private Sub Co mmand1_Click()
Open "out .txt"For Output As #1
Print #1,Text1.Text
Close #1
End Sub
C.Private Sub Co mmand1_Click()
Open "out .txt"For Append As #1
Print #1,Text1.Text
Close #1
End Sub
D.Private Sub Co mmand1_Click()
Open "out .txt"For Rando m As #1
Print #1,Text1.Text
Close #1
End Sub
参考答案:
答案解析: