Open App.Path & "\1.txt" For Input As #1 Index = 0 Do While Not EOF(1) Line Input #1, s Text1.Text = Text1.Text & vbCrlf & s Loop Close #1如果在局域网中,就共享
Private Sub Command1_Click() Dim x As String Me.CommonDialog1.Filter = "*.TXT|*.txt" Me.CommonDialog1.ShowOpen Open Me.CommonDialog1.FileName For Input As #1 Do While Not EOF(1) Line Input #1, x Text1.Text = Text1.Text & x Loop Close #1 '不管是本地还是其他机器,只要commondialog能见到的就可以打开 End Sub
Index = 0
Do While Not EOF(1)
Line Input #1, s
Text1.Text = Text1.Text & vbCrlf & s
Loop
Close #1如果在局域网中,就共享
Dim x As String
Me.CommonDialog1.Filter = "*.TXT|*.txt"
Me.CommonDialog1.ShowOpen
Open Me.CommonDialog1.FileName For Input As #1
Do While Not EOF(1)
Line Input #1, x
Text1.Text = Text1.Text & x
Loop
Close #1
'不管是本地还是其他机器,只要commondialog能见到的就可以打开
End Sub