VB.Net Tutorial/Stream File/BinaryReader — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 16:40, 26 мая 2010
Read by using BinaryReader
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