AW: [Mono-list] Linux or Windows?
InTheMood
inthemood at gmx.net
Sun Nov 13 14:26:29 EST 2005
if everything could be so easy like a DirectorySeparatorChar...
somebody else gave me a link to this one. works fine too!
int p = (int) Environment.OSVersion.Platform;
if ((p == 4) || (p == 128))
{
Console.WriteLine ("Running on Unix");
}
else
{
Console.WriteLine ("NOT running on Unix");
}
thanks for the tips.
>Hi,
>
>try using
>
>Path.DirectorySeparatorChar
>
>Will return "/" running on Linux and "\" runnging on Windows :-)
>
>HTH
>Jan Waiz
>
>-----Ursprüngliche Nachricht-----
>Von: mono-list-bounces at lists.ximian.com
>[mailto:mono-list-bounces at lists.ximian.com] Im Auftrag von InTheMood
>Gesendet: Sonntag, 13. November 2005 18:23
>An: mono-list at lists.ximian.com
>Betreff: [Mono-list] Linux or Windows?
>
>hello,
>
>how to detect if the app is running on Linux or Win?
>
>i'm pretty new to all this linux stuff.
>
>cheers
>_______________________________________________
>Mono-list maillist - Mono-list at lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/mono-list
>
>
>
>
More information about the Mono-list
mailing list