读书人

C# 获取 windows mobile 操作系统版本

发布时间: 2012-01-30 21:15:58 作者: rapoo

C# 获取 windows mobile 操作系统版本
请问如何用C#获得windows mobile的版本信息?
想获取的是windows mobile 6.1、windows mobile 5.0这样的版本号,而不是CE5.2.21231这样的信息。

多谢!

[解决办法]

C# code
////// 操作系统版本信息/// public struct OSVERSIONINFO{    internal int dwOSVersionInfoSize;    ///    /// 主版本信息    ///     public int dwMajorVersion;    ///     /// 副版本信息    ///     public int dwMinorVersion;    ///     /// 编译信息    ///     public int dwBuildNumber;    ///    /// 操作系统类型    ///     public PlatformType dwPlatformId;}[DllImport("rapi.dll", CharSet=CharSet.Unicode, SetLastError=true)]internal static extern bool CeGetVersionEx(out OSVERSIONINFO lpVersionInformation);bool b;versionInfo.dwOSVersionInfoSize = Marshal.SizeOf(typeof(OSVERSIONINFO));    // 设置为结构大小b = CeGetVersionEx(out versionInfo);if(!b){    throw new Exception("Error retrieving version information.");}
[解决办法]
楼主请看我的回复。
操作系统的支持:

Requirements
Pocket PC: Pocket PC 2000 and later
Smartphone: Smartphone 2002 and later
OS Versions: Windows CE 3.0 and later
Header: Rapi.h
Library: Rapi.lib


难道不是在PPC上面么?
只要PPC2000以后的版本就支持CeGetVersionEx函数

读书人网 >Windows Mobile

热点推荐