[Mono-list] How can the assembly check the OS it's on?

Scott Blomfield Scott.Blomfield@cavalryinvestments.com
Fri, 7 Mar 2003 16:00:44 -0600

I thought I'd add 2c to all the posts so far, even though this one has
far less information than would be helpful...

The DOS environment variable OS is set to the windows type.
On Windows XP it will show "Windows_NT"
>From mbas (VB.NET) you should be able to get this via Envron("OS") if
they have implemented the Environ function. I do not know if C# exposes
a way to
find out environment settings. (I do not know C#). I also do not know
if previous versions of windows export this environment variable. That's
a lot of I don't knows sorry.

Hope this helps somewhat,


-----Original Message-----
From: Auge Mike [mailto:tobe_better@hotmail.com]=20
Sent: Friday, March 07, 2003 3:19 PM
To: charlouis.mono@wanadoo.be; mono-list@lists.ximian.com
Subject: Re: [Mono-list] How can the assembly check the OS it's on?

>I'd like my compiled assembly to detect it, and I'd rather not use an
>App.config file for this.

I think that you need to use Pinvoke. For Windows you can use the
to get the Windows name and version, and in Linux you can get the
from the Environment variable,


Help STOP SPAM with the new MSN 8 and get 2 months FREE* =20

Mono-list maillist  -  Mono-list@lists.ximian.com