![]() Using sr As StreamReader = New StreamReader("e:/jamaica.txt") ' The using statement also closes the StreamReader. ' Create an instance of StreamReader to read from a file. The file reads −Īnd the sun shines daily on the mountain top ![]() The following example demonstrates reading a text file named Jamaica.txt. Reads the next character from the input stream and advances the character position by one character. Public Overrides Function Read As Integer Returns the next available character but does not consume it. Public Overrides Function Peek As Integer It closes the StreamReader object and the underlying stream and releases any system resources associated with the reader. The following table describes some of the commonly used methods of the StreamReader class − Sr.No. The StreamReader class also inherits from the abstract base class TextReader that represents a reader for reading series of characters. These classes inherit from the abstract base class Stream, which supports reading and writing bytes into a file stream. The StreamReader and StreamWriter classes are used for reading from and writing data to text files.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |