Reading byte array from files in Visual Basic <p>I have a code for Visual Basic programming language that reads byte array from files, I use that code:</p> <pre><code>Imports System.IO Imports System.Threading Public Class Form1 Dim thread As New Thread(AddressOf RW_EXE) Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click With OpenFileDialog1 If .ShowDialog() = Windows.Forms.DialogResult.OK Then thread.IsBackground = True Control.CheckForIllegalCrossThreadCalls = False thread.Start() End If End With End Sub Sub RW_EXE() RichTextBox1.Text = "" Dim FS As New FileStream(OpenFileDialog1.FileName, FileMode.Open, FileAccess.Read) Dim BS As New BinaryReader(FS) Dim x As Integer = BS.BaseStream.Position Dim y As Integer = BS.BaseStream.Length Dim s As String = "" ProgressBar3.Maximum = y While x &lt; y RichTextBox1.Text &amp;= BS.ReadByte.ToString("X") &amp; " " ProgressBar3.Value = x x += 10 End While RichTextBox1.Text = s FS.Close() BS.Close() thread.Abort() End Sub </code></pre> <p>That code does it's job well, but I have one problem, It's very slow, it takes big time to read array bytes from files with size of 100 KB and from bigger files.</p> <p>Please, help.</p> <p>Thanks for attention.</p>