My.Computer.FileSystem.ReadAllText : FileSystem « Stream File « VB.Net Tutorial






Public Class Tester
    Public Shared Sub Main

        Dim csvFile As String = My.Application.Info.DirectoryPath & "\Test.csv"
        Dim outFile As IO.StreamWriter = My.Computer.FileSystem.OpenTextFileWriter(csvFile, False)


        outFile.WriteLine("Column 1, Column 2, Column 3")
        outFile.WriteLine("1.23, 4.56, 7.89")
        outFile.WriteLine("3.21, 6.54, 9.87")
        outFile.Close()

        Console.WriteLine(My.Computer.FileSystem.ReadAllText(csvFile))
    End Sub

End Class
Column 1, Column 2, Column 3
1.23, 4.56, 7.89
3.21, 6.54, 9.87








13.7.FileSystem
13.7.1.List all available Drives
13.7.2.Find in files
13.7.3.My.Computer.FileSystem.ReadAllText
13.7.4.My.Computer.FileSystem.WriteAllText
13.7.5.My.Computer.FileSystem.CurrentDirectory
13.7.6.Test for a valid directory
13.7.7.My.Computer.FileSystem.DirectoryExists
13.7.8.Drive TotalFreeSpace, AvailableFreeSpace and TotalSize
13.7.9.My.Computer.FileSystem.FileExists(''FileName'')
13.7.10.Use pattern(wildcard) to match directories
13.7.11.Use pattern(wildcard) to match files
13.7.12.My.Computer.FileSystem.FindInFiles
13.7.13.My.Computer.FileSystem.GetParentPath