在C盘当前文件夹下有一个已建立好的顺序文件Alph.txt,文件内容为只含有字母的一个字符串(有双引号界定符)。单击窗体,打开Alph.txt文件,读取字符串并显示在文本框Text1中,然后调用StrSort过程将此字符串按ASCII码的顺序重新排列并显示在文本框Text2,最后将重新排列的字符串存入AlpO.txt文件中(无双引号界定符)。请选择横线处合适的语句 ( )。
Private Sub Form_Load()
Dim StrIn As String, StrOut As String
Open "C:\Alph.txt" For Input As #1
______
Close
Text1.Text=StrIn
______
Text2.Text=StrOut
Open "C:\AlpO.txt" For Output As #2
______
Close
End Sub
Private Function StrSort(s As String) As String
Dim sArr() As String *1, i As Integer,j As Integer, n As Integer
Dim t As String *1
n=Len(s)
ReDim sArr(n)
For i=1 To n
sAn(i)=Mid(s,i,1)
Next i
For i=1 To n-1
For j=i+1 To n
If sArr(i)>sArr(j) Then
t=sAn(i):sArr(i)=sArr(j):sArr(j)=t
End If
Next j,i
For i=1 To n
StrSort=StrSort & sArr(i)
Next i
End Function
A.Input #1, StrIn StrIn Print #2, StrOut
B.Input #1, StrIn StrSort(StrIn) Print #2, StrOut
C.Input #2, StrIn StrSort(StrIn) Print #1, StrOut
D.Print #1, StrIn StrSort(StrIn) Input #2, StrOut