VB.Net Tutorial/Data Type/StringReader StringWriter

Материал из VB Эксперт
Перейти к: навигация, поиск

StringWriter and StringReader

Imports System.IO
public class Test
   public Shared Sub Main
        Dim string_writer As New StringWriter()
        string_writer.WriteLine("The quick brown fox")
        string_writer.WriteLine("jumps over the lazy dog.")
        Console.WriteLine(string_writer.ToString)
        " Use a StringReader to read from the string.
        Dim string_reader As New StringReader(string_writer.ToString)
        string_writer.Close()
        Console.WriteLine(string_reader.ReadLine())
        Console.WriteLine(string_reader.ReadToEnd())
        string_reader.Close()

   End Sub
End class
The quick brown fox
jumps over the lazy dog.
The quick brown fox
jumps over the lazy dog.