第1个回答 2009-07-31
Private Sub Command1_Click()
Dim s As String
Dim a As String
Open "c:\abc.txt" For Input As #1
If Not EOF(1) Then
Input #1, s
End If
While Not EOF(1)
s = s & vbCrLf
Input #1, a
s = s & a
Wend
Close #1
Text1.Text = s
End Sub
是要把文本框内容存到文件还是
第2个回答 2009-07-31
读取文件:
Dim InputData As String*1
Open"C:\abc.txt" For Input As #1
Do While Not EOF(1)
InputData=Input(1,#1)
Text1.Text=Text1.Text+InputData
Loop
Close#1
替换原来文件的内容:
Dim OutputData As String
Open"C:\abc.txt" For Output As #1
Print#1,Text1.Text
Close#1