To determine the operating system service pack and some information about the operating system i first read and then i search is there any other way in the managed code to do so without using the window API. Then i come across the following finding.
The System.Environment class contain the OSversion property which contain the following operating system related information. The Platform, ServicePack, Version and the VersionString properties are expose to get those information.
The Environment.OSVersion.Platform property return the enumeration to help determine whether the current operating system or development platform supports your application. Here is the list of the PlatformID named constant.
|The operating system is Win32s. Win32s is a layer that runs on 16-bit versions of Windows to provide access|
to 32-bit applications.
|The operating system is Windows 95 or later.|
|The operating system is Windows NT or later.|
|The operating system is Windows CE.|
|The operating system is Unix.|
|The development platform is Xbox 360.|
|The operating system is Macintosh.|