Has anyone experienced a problem when loading a text file to a textbox using the ReadToEnd method? I am consistantly experiencing a file truncation issue at 16,307 bytes when using method 1 below. I have switched to method 2, which reads the entire file into the textbox, but I would like to know why it is happening. Thanks in advance
Dim l_objLog As New StreamReader(l_sFileName)
'Method 1 (not working):
txtLog.Text = l_objLog.ReadToEnd
'Method 2:
Do Until l_objLog.EndOfStream
txtLog.AppendText(l_objLog.ReadLine & vbCrLf)
Loop
Dim l_objLog As New StreamReader(l_sFileName)
'Method 1 (not working):
txtLog.Text = l_objLog.ReadToEnd
'Method 2:
Do Until l_objLog.EndOfStream
txtLog.AppendText(l_objLog.ReadLine & vbCrLf)
Loop