FileMode.Open with FileAccess.Read : FileMode « Stream File « VB.Net Tutorial






Imports System.IO


Public Class Tester
    Public Shared Sub Main
        Dim f As System.IO.FileStream
        Dim r As System.IO.StreamReader
        Dim mylength As Integer
        Dim i As Integer
        f = New System.IO.FileStream("test.txt", IO.FileMode.Open, IO.FileAccess.Read)
        r = New System.IO.StreamReader(f)
        Console.WriteLine(r.ReadToEnd())
        f.Close()
        r.Close()

    End Sub

End Class








13.5.FileMode
13.5.1.FileMode.OpenOrCreate
13.5.2.FileMode.Open with FileAccess.Read
13.5.3.Create File with FileMode.CreateNew