How to get the current MAC OSX version programmatically?

PreranaPrerana INMember ✭✭

Hello All,

I need to determine the current version of Mac OSX my application is running on.


Searching on net I read about Gestalt system call which is in CoreServices, but I could not find this method in MonoMac.
(Note: Many suggested not to use Gestalt anymore as it is deprecated from Mac OSX 10.8)


What is the exact way to do it??

Thanks in Advance!!

Best Answer

Answers

  • DaveHuntDaveHunt USMember ✭✭✭✭✭

    Have you tried System.Environment? There are OSVersion and Version static members that should give you what you need (maybe - don't have access to check this myself at the moment).

  • PreranaPrerana INMember ✭✭

    @DaveHunt,


    I explored the System.Environment 's OSVersion and Version variables

          Console.WriteLine (System.Environment.OSVersion);
    



    Returns me

          Unix 13.0.0.0
    


    And

          Console.WriteLine (System.Environment.Version);
    


    Returns me

          4.0.30319.17020
    



    @robertmiles3 way is apt to the point.

    Thanks for answering..:)

  • PreranaPrerana INMember ✭✭

    @robertmiles3‌,

    This was exactly what I was looking for!!..I had actually gone till

         NSProcessInfo.ProcessInfo
    


    which was giving me

        <NSProcessInfo: 0x4087000>
    


    Little should I have cared to see that it has a property too ...:P

    Nevertheless, Thanks a ton for the answer it resolved my issue..:):)

Sign In or Register to comment.