Private Sub Command1_Click()
Dim Str, Sav As String
If Len(File1.FileName) <> 0 Then
Str = ""
Open Dir1.Path & File1.Path & File1.FileName For Input As #1
Do While Not (EOF(1))
Line Input #1, Sav
Str = Str + Sav + vbCrLf
Loop
Close #1
Form1.Text1.Text = Str
Else
MsgBox "不能为空!"
End If
Me.Hide
End Sub
Private Sub Command2_Click()
Me.Hide
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Form_Load()
File1.Pattern = "*.txt"
End Sub
这是我写的代码,,你看看那里有错误!~~~
Dim Str, Sav As String
If Len(File1.FileName) <> 0 Then
Str = ""
Open Dir1.Path & File1.Path & File1.FileName For Input As #1
Do While Not (EOF(1))
Line Input #1, Sav
Str = Str + Sav + vbCrLf
Loop
Close #1
Form1.Text1.Text = Str
Else
MsgBox "不能为空!"
End If
Me.Hide
End Sub
Private Sub Command2_Click()
Me.Hide
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Form_Load()
File1.Pattern = "*.txt"
End Sub
这是我写的代码,,你看看那里有错误!~~~