VB.Net Tutorial/Stream File/BinaryWriter

Материал из VB Эксперт
Версия от 15:56, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Write data by using a BinaryWriter

<source lang="vbnet">Imports System.IO

Public Class Tester

   Public Shared Sub Main
       Dim fs As System.IO.FileStream
       Dim w As System.IO.BinaryWriter
       Dim buffer As String
       Dim c As Char
       c = Chr(9)
       fs = New System.IO.FileStream("test.txt", IO.FileMode.OpenOrCreate)
       w = New System.IO.BinaryWriter(fs)
       w.Seek(0, System.IO.SeekOrigin.Begin)
       w.Write("writing data via BinaryWriter")
       w.Close()
       fs.Close()
   End Sub

End Class</source>