2013-10-22 33 views

回答

1

您将需要查看File.ReadLines函数的System.IO命名空间,它将返回IEnumerable(Of String),然后您可以遍历该函数。

Imports System.IO 
Module Module1 

    Sub Main() 
     Dim lines As IEnumerable(Of String) = File.ReadLines("Your File Path Here") 
     For Each line As String In lines 
      Console.WriteLine(line) 
     Next 
     Console.ReadLine() 
    End Sub 

End Module 
+0

我在我的问题中粘贴了代码。不知道为什么它不显示,但在这里又是。 – Barryal

+0

@Barryal在你的问题中没有看到它,时间戳记最后编辑于2013年10月22日,再试一次。 3年后你还在经历这个问题吗? –