[Mono-list] Question about System.PlatformID

Kevin White Kevin White <jedirunner@gmail.com>
Sat, 6 Nov 2004 10:41:14 -0700

I notice when writing some sample code using the System.Environment,
that the System.PlatformID enum is only containing values for Windows
platforms.  For Environment.OSVersion.Platform, I get 128 (running on
Linux).  But that doesn't seem to be in the enum.

Here's a snippet from my code:

Console.WriteLine("OS.Platform ==> " + os.Platform);
//Print out the values from the System.PlatformID enumeration
String[] names=Enum.GetNames(typeof(System.PlatformID));
Array values=Enum.GetValues(typeof(System.PlatformID));
for(int x=0; x < names.Length; x++){
    Console.WriteLine("\t{0} : {1}", (int)values.GetValue(x), names[x]);

I get the following output:

OS.Platform ==> 128
0 : Win32S
1 : Win32Windows
2 : Win32NT
3 : WinCE

Will the PlatformID structure be enhanced to have all the values?  Am
I doing something wrong in enumerating the enumeration?


Kevin White