When using ReadAllText method to read a log file with a size of 21.83MB, it takes between  7 seconds (for powerful CPU) to 12 seconds (for weak CPU).

SOLUTION SOLVED?
1. I’ve used all possible method for loading .log/.txt extension file type into TextBox in VB.Net, eg. ReadLine, ReadAllLines, ReadAllText, ReadToEnd, but all methods result are the same. But the time load for the .log file is not actually long when execute in my laptop
2. I think we should just stick with the current code because every solution that i found on the internet using the same all methods that i just mentioned. Probably will take much more longer time if want to solve this problem.
Failed

Source:

Dim file As New FileInfo("path\to\file")

ProcessLine(nextLine)
End While
End Using

NO

This method generates error maybe because the memory usage increase overtime due to many lines data read
I’m not sure what cause the error but the detail can be found here:

Or maybe because i don’t actually know the correct way to use this method

Source:

Const MAX_BYTES As Integer = 1048576 * 5 '=10 MB
Dim currentPos As Integer = 0
Dim strFileName As String
Dim strm As System.IO.Stream
Dim TextLine As String
Dim FileDetail As IO.FileInfo

OpenFileDialogMain.ShowDialog()
strm = OpenFileDialogMain.OpenFile()
strFileName = OpenFileDialogMain.FileName.ToString()

System.IO.File.OpenText(strFileName)
End Using

txtEditor.Text += TextLine
txtEditor.Text = txtEditor.Text & vbCrLf & Now

NO

This method can be used to fetch .log file but a bit slower than ReadAllText() method.

Completion time to load the log file into textbox is approximately 11-12 seconds

Source:

NO

This method opens a text file, reads all lines of the file into a string array, and then closes the file.

To load the string array into the textbox will use the same method as ReadLine() which is using Looping

## Test Methodology

TEST DELL-E6410 MSI

How long does it take for Control Panel to load the log file
“X:\Support\Support Cases\264 (I19-2460-MACRO-ASP)\2020_1_14.log”, File size: 21.83MB

No result because of error No result because of error