[Mono-list] Determining the platform at compile and run time

John Luke jluke@users.sourceforge.net
Wed, 29 Oct 2003 12:47:34 -0500


On Wed, 2003-10-29 at 12:33, Chris Seaton wrote:
> How do I know what OS my program is running on at run time? PlatformID
> contains no entry for any systems apart from Windows.
> 
Are you sure? There should be a PlatformID.Unix (on mono at least).  You
could also test System.IO.Path.DirectorySeperatorChar. See also,
http://www.nullenvoid.com/mono/wiki/index.php/DeveloperFaq
> How about compile time? Is there something I can test for with a #if?
> 
> Thanks.