با سلام!
فكر مي كنم منظورتون اينه كه چه جوري يه فايل رو به طور باينري بخونيم.
براي اين كار ميشه از تابع زير استفاده كرد:
اين تابع با گرفتن مسير فايل، اون رو به طور باينري مي خونه. پس از خوندن هر فايل به طور باينري مي تونيد با ايجاد يه حلقه تك تك بيت ها رو با هم مقايسه كنيد. سعي مي كنم به زودي سورس كاملش رو تهيه كنم و قرار بدم.کد:Imports System.IO Public Class IO_Library Public Shared Function ReadBinaryData(ByVal path As String) As Byte() ' Open the binary file. Dim streamBinary As New FileStream(path, FileMode.Open) ' Create a binary stream reader object. Dim readerInput As BinaryReader = New BinaryReader(streamBinary) ' Determine the number of bytes to read. Dim lengthFile As Integer = FileSize(path) ' Read the data in a byte array buffer. Dim inputData As Byte() = readerInput.ReadBytes(lengthFile) ' Close the file. streamBinary.Close() readerInput.Close() Return inputData End Function 'ReadBinaryData' Public Shared Function FileSize(ByVal path As String) As Integer Dim info As New FileInfo(path) Return info.Length End Function 'FileSize' End Class 'IO_Library'
منبع كد
موفق باشيد
آرمين
Bookmarks