public static extern bool GetVersionOS(ref OSVersionInfo osvi);
/// <summary> /// Constructor. /// </summary> public CipOsVersion() { _computerInfo = new ComputerInfo(); _osVersion = new OSVersionInfo(); _osVersion.dwOSVersionInfoSize = (uint)Marshal.SizeOf(_osVersion); CipWrapper.GetVersionOS(ref _osVersion); if (_osVersion.dwMajorVersion == 5) { switch (_osVersion.dwMinorVersion) { case 1: _osType = CipOsType.Windows51; break; } } else if(_osVersion.dwMajorVersion == 6) switch (_osVersion.dwMinorVersion) { case 0: _osType = CipOsType.Windows60; break; case 1: _osType = CipOsType.Windows61; break; } }