I write a lot of software that interacts with older systems, Unix servers,
and the like (U.S. government agencies), using protocols like FTP, UDP, and
Telnet. Once you step out of the Microsoft sandbox, you're in a world of
trouble, as JS pointed out. A newline isn't a newline when you move data
across different platforms. I have even had to write code that inserts
"\r\r\n" at the end of a line, due to a proprietary (and probably ancient)
format in use by the U.S. National Weather Service's METAR data FTP server.
So, the real answer is, inside the Microsoft sandbox, Environment.Newline is
fine. "\r\n" is fine. When interacting with other systems, a little research
is always in order. I have also found out that when receiving data from
other sources, you often have to watch out for default .Net conversions.
Sometimes the platform is a bit too automatic for my own good! Still, it has
built-in mechanisms to deal with these sorts of cases, but you do have to
watch out for them.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.