Hello,
I would like to ask a little advice, what would be the best way to read text files into TextBox control?
I just need to read a simple text file and display it's context in TextBox. I thought, the best way would be to use FileReadToEnd() function, however when I read text file using this function I am loosing all line breaks, text is displayed all on one line with no line breaks.
I was trying to read file using FileRead() function in the loop, however while doing that I always receive an exception:
"Input string is not in the correct format"
Not sure, if it is because of file containing some non-ascii characters, however it should not be, the simple text file. I was trying to read using FileRead several text files, they all give me that exception.
Please tell me, what would be the best way to read the text file and output it to the TextBox control with line breaks and with no errors regardless of file context.
Many thanks in advance for any help.
Igor.
I would like to ask a little advice, what would be the best way to read text files into TextBox control?
I just need to read a simple text file and display it's context in TextBox. I thought, the best way would be to use FileReadToEnd() function, however when I read text file using this function I am loosing all line breaks, text is displayed all on one line with no line breaks.
I was trying to read file using FileRead() function in the loop, however while doing that I always receive an exception:
"Input string is not in the correct format"
Not sure, if it is because of file containing some non-ascii characters, however it should not be, the simple text file. I was trying to read using FileRead several text files, they all give me that exception.
Please tell me, what would be the best way to read the text file and output it to the TextBox control with line breaks and with no errors regardless of file context.
Many thanks in advance for any help.
Igor.