[单项选择题] 在窗体中添加一个命令按钮Commandl和一个文本框Text1,编写命令按钮Com-mand1 的 Click事件代码; Private Sub Command1_Click() Dim S As String*20 S=Text1. Text End Sub 该程序的功能是当单击按钮Command1时,把变量S中内容写入一个顺序文件 datl. dar中,正确的程序段是 ( )
A.Open "dat dat", For lnput As#1 Write井1,S
B.Open"dat dat" For Output As#1 Write#1, S
C.Open"dat", For Binary As #1 Write #1, S Close #1
D.Open dat dat"For Random As #1Write #1, SClose #1