[Cf skills]. Net cf3.5 determines the platform type (version number) of the device)
Source: Internet
Author: User
In versions earlier than cf3.5, to determine the platform type (smartphone? PPC? PPC pone ?), We need to call it through P/invoke
SystemparametersinfoFor more information about this local function, see the following two articles:
Https://blogs.msdn.com/netcfteam/archive/2006/09/15/756755.aspx
Http://blogs.msdn.com/netcfteam/archive/2006/09/22/766343.aspx
However, a new name named
Systemsettings. PlatformFor more information about other new features of cf3.5, see here.
The following code snippet demonstrates how to conveniently implement this function:
// The opennetcf. environmentex. platformname of SDF can also be used to determine whether it is PPC or smart phone.
// But the current. Net CF can do better.
If (systemsettings. Platform = winceplatform. pocketpc)
Platformname = "Windows Mobile" +
(Systemstate. phoneradiopresent? "Professional": "classic"); // professional
Else if (systemsettings. Platform = winceplatform. Smartphone)
Platformname = "Windows Mobile standard ";
Else
Platformname = "not Windows Mobile ";
You also need to add references to the following Assembly:
Among them, systemstate. phoneradiopresent must be ce5.0 or above.
Interestingly, I successfully returned "Windows Mobile professional" after testing on Samsung i718, but I always returned "Windows Mobile classic" when testing all PPC simulators on the simulator ".
It turns out that when running on a Windows Mobile professional SDK simulator, you must first connect to cellular emulator to make phoneradiopresent return the correct value (the simulator is considered to have no phone function by default ), cellular emulator can be used to simulate the telephone function. for more information about how to use cellular emulator, see here.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.