Within a C# program, is there any way to tell if a file is a text file or not? I mean a real way, not just basing your conclusion on a file name extension.
EXE's always start with "MZ". Beyond that you can do a character frequency analysis on the file. Binary files will yield a more random pattern, while a text file will be almost entirely printable ASCII. I have code somewhere that does such a thing if you're interested, though it's in QBASIC.
__________________ 'If you don't stand for somethin, you'll fall for anything' - Dr. Dre Been there, done that
Most file formats start with some kind of ASCII character or word at the beginning of the file. Like wave files use the word RIFF as its first 4 characters. That would be the way you can tell.