I´ve tried this code for 200 KB file, but it takes too long to display (3 minutes and still nothing)
Also, forcing garbage collector only freed 10KB as I seen in taskmgr. But, freeing unused memory AFTER loading the text isn´t that important for now, problem is that it takes too long TO DISPLAY. Problem persist even if I want simply load textfile without any additional operations. The same problem I have with notepad. I don´t know if these two problems are the same - most likely yes. How it can be resolved? I thought about resetting notepad´s registry settings to default, but if there´s simplier way, I´m listening...Code:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim bytes As Byte() = IO.File.ReadAllBytes("C:\users\acer\desktop\file.txt") Dim sb As New System.Text.StringBuilder() For Each b As Byte In bytes sb.Append(b.ToString("X2")) sb.Append(" ") Next Dim str As String = sb.ToString RichTextBox1.Text = str End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click GC.Collect() End Sub




Reply With Quote
