[Mono-list] Linux or Windows?

Jonathan Pryor jonpryor at vt.edu
Sun Nov 13 14:15:36 EST 2005


On Sun, 2005-11-13 at 18:23 +0100, InTheMood wrote:
> how to detect if the app is running on Linux or Win?

See:
http://www.mono-project.com/FAQ:_Technical#How_to_detect_the_execution_platform_.3F

You can also check the value of System.IO.Path.DirectorySeparatorChar,
which is \ on Windows and / on Unix platforms.  This is arguably less
portable (if some future non-Unix platform uses '/' as a directory
separator), but lots of existing Mono code makes this assumption.

 - Jon




More information about the Mono-list mailing list