单选题 VB
题号 #142361

窗体上有1个名称为Text1的文本框和1个名称为Command1的命令按钮。要求程序运行时,单击命令按钮,就可以把文本框中的内容写到文件out.txt中,每次写入的内容附加到文件原有内容之后。下面能够实现上述功能的程序是(  )。
A.Private Sub Command1_Click()
   Open “out.txt” For Inpit As#1
   Print#1,Text1.Text
      Close#1
  End Sub
B.Private Sub Command1_Click()
   Open “out.txt” For Outpit As#1
   Print#1,Text1.Text
      Close#1
  End Sub
C.Private Sub Command1_Click()
   Open “out.txt” For Append As#1
   Print#1,Text1.Text
      Close#1
  End Sub
D.Private Sub Command1_Click()
   Open “out.txt” For Random As#1
      Print#1,Text1.Text
      Close#1
  End Sub

进入在线模考

参考答案

C

答案解析

暂无解析

你可能感兴趣的试题

A.While …Wend循环语句错误,应改为For k=1 To 99 …Next k  
B.循环条件错误,应改为Whlie k<99  
C.循环前的赋值语句k=1错误,应改为k=0  
D.循环中两条赋值语句的顺序错误,应改为s=s+k : k=k+2
找试题 · 找答案 · 找资料 在线模考