积极答复者
怎么样判断手机的版本

问题
答案
-
首先WinCE/WM平台不支持managed c++, 所以上面提到的方法不行。
我们可以用调用GetVersionEx方法来得到手机版本,就下面的代码:
OSVERSIONINFO a;
GetVersionEx(&a);
具体代码请看:
http://msdn.microsoft.com/en-us/library/aa909182.aspx
Please remember to mark the replies as answers if they help and unmark them if they provide no help- 已标记为答案 Guang-Ming Bian - MSFTModerator 2009年10月28日 3:53
全部回复
-
你好,可以使用Environment.OSVersion.Version和Environment.OSVersion.Platform来获取你需要的信息。
可以参考MSDN:http://msdn.microsoft.com/en-us/library/system.environment.osversion.aspx
和论坛的帖子:http://www.longhorncorner.com/Forums/ShowMessages.aspx?ThreadID=67655
施炯 -
你好,可以使用Environment.OSVersion.Version和Environment.OSVersion.Platform来获取你需要的信息。
可以参考MSDN:http://msdn.microsoft.com/en-us/library/system.environment.osversion.aspx
和论坛的帖子:http://www.longhorncorner.com/Forums/ShowMessages.aspx?ThreadID=67655
施炯
谢谢,但这个代码是C#的,有没有C++的? -
http://msdn.microsoft.com/en-us/library/system.environment.osversion.aspx这个帖子里有C++的示例程序:
// Sample for the Environment::OSVersion property
using namespace System;
int main()
{
Console::WriteLine();
Console::WriteLine( "OSVersion: {0}", Environment::OSVersion );
}
施炯 -
http://msdn.microsoft.com/en-us/library/system.environment.osversion.aspx 这个帖子里有C++的示例程序:
// Sample for the Environment::OSVersion property
using namespace System;
int main()
{
Console::WriteLine();
Console::WriteLine( "OSVersion: {0}" , Environment::OSVersion );
}
施炯
你好,我用了这段代码之后,error:C2871:'System': a namespace with this name does not exist. 网上说要设置/clr,但是我按照网上的方法没有找到Common Language Runtime suport这样的地方. 是不是MFC项目的不能用CLR? -
首先WinCE/WM平台不支持managed c++, 所以上面提到的方法不行。
我们可以用调用GetVersionEx方法来得到手机版本,就下面的代码:
OSVERSIONINFO a;
GetVersionEx(&a);
具体代码请看:
http://msdn.microsoft.com/en-us/library/aa909182.aspx
Please remember to mark the replies as answers if they help and unmark them if they provide no help- 已标记为答案 Guang-Ming Bian - MSFTModerator 2009年10月28日 3:53
-
首先WinCE/WM平台不支持managed c++, 所
我们可以用调用GetVersionEx方法来得到手机版本,就下面的代码:
OSVERSIONINFO a;
GetVersionEx(&a);
具体代码请看:
http://msdn.microsoft.com/en-us/library/aa909182.aspx
Please remember to mark the replies as answers if they help and unmark them if they provide no help
谢谢,我发现调用了这个之后,得到的数据是这样的:
INfoSize 276
MajorVersion 5
dwMinorVersion 2
szCSDVersion ""
怎么szCSDVersion为空的?