查看答案
'正确的程序
Private Sub C1_Click()
Dim a As String
CD1.Filter = "所有文件|*.*|文本文件|*.txt|Word文件|*.doc"
CD1.FilterIndex = 2
CD1.Action = 1
Open CD1.FileName For Input As #1
Input #1, a
Close #1
Text1.Text = a
End Sub
Private Sub C2_Click()
Dim a As String, b As String, c As String, k As Integer, n As Integer
a = Text1.Text
b = ""
n = Asc("a") - Asc("A")
For k = 1 To Len(a)
c = Mid$(a, k, 1)
If c >= "a" And c <= "z" Then
c = String(1, Asc(c) - n)
End If
b = b + c
Next k
Text1.Text = b
End Sub
Private Sub C3_Click()
CD1.FileName = "out5.dat"
CD1.Action = 2
Open CD1.FileName For Output As #1
Print #1, Text1.Text
Close #1
End Sub