How do I know programmatically whether my OS is Longhorn server or Vista (client).
It seems the major version and minor version are same for both:
http://msdn.microsoft.com/en-us/library/ms724833.aspx
So, is there any better alternative?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Doesn’t that same page you link give you the answer?
Just check the
wProductTypemember againstVER_NT_WORKSTATIONedit
Doesn’t look like there’s a way to get this without P/Invoke.
System.Environment.OSVersiondoesn’t expose this level of detail, and though there is aninternal static class Win32Nativein theMicrosoft.Win32namespace inmscorlib, as far as I can tell from disassembly, there’s nothing that uses, let alone exposes,wProductType.I have found (but not tried) this page on pinvoke.net.