VB.Net Tutorial/Stream File/BinaryReader — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 15:56, 26 мая 2010
Read by using BinaryReader
<source lang="vbnet">Imports System.IO
Public Class Tester
Public Shared Sub Main Dim fs As System.IO.FileStream Dim r As System.IO.BinaryReader Dim buffer(100) As Char Dim mylength As Long fs = New System.IO.FileStream("test.txt", IO.FileMode.OpenOrCreate) r = New System.IO.BinaryReader(fs) mylength = fs.Length If mylength > 100 Then mylength = 100 End If r.Read(buffer, 0, mylength) Console.WriteLine(buffer) r.Close() fs.Close() End Sub
End Class</source>