VB.NET determine if a file is ASCII text before opening?
Tony Lewis
1
Reputation point
One can select a file via OpenFileDialog, and set the file filters to .TXT or other extensions to limit input files to text based files. However, it is possible to have an ASCII text file that has no extension, or the wrong extension. Likewise, binary files can have .txt or other file extensions when they are not text based.
Is there a way to check a file when selected and determine if its contents are ASCII text based before (or after) the file contents are read?