如何读去本地目录下的一个记事本文件中的内容 在VB控件的下显示出来?如果记事本文件是在局域网的某一台机子上又该怎么实现呢? 望各位大虾多多指教。

解决方案 »

  1.   

    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如果在局域网中,就共享
      

  2.   

    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
      

  3.   

    Open "\\计算机名或IP\共享文件夹名\1.txt" For Input As #1