Burdasınız :Ana Sayfa » Visual Basic » Visual Basic - Read File Line by Line in The Visual Studio

Visual Basic - Read File Line by Line in The Visual Studio

Imports System.IO

Module Module1

    Sub Main()

        Dim path As String = Directory.GetCurrentDirectory()
        path = Directory.GetParent(Directory.GetParent(path).ToString()).ToString()
        Dim file As StreamReader = New StreamReader(path & "\\file.txt")
        Dim str As String
        str = file.ReadLine()
        While (str IsNot Nothing)
            Console.WriteLine(str.ToString())
            str = file.ReadLine()
        End While
        Console.ReadLine()
    End Sub

End Module


0 yorum:

Yorum Gönder