简体   繁体   中英

How to get the number of Processors on Windows Phone

I'm wondering how to get the number of processors on Windows Phone... as documented in the MSDN the following statement always throws a MethodAccessException:

Environment.ProcessorCount

Any help would be appreciated.

Thanks, j3d

As described in MSDN this Property has a SecurityCriticalAttribute that makes for internal only, you can't use from your application. From MSDN:

This member has a SecurityCriticalAttribute attribute on Silverlight for Windows Phone, because the attribute was present in Silverlight 3. This attribute restricts this member to internal use. Application code that uses this member throws a MethodAccessException.

根据论坛帖子(链接到您提到的MSDN 文档) ,您无法以编程方式在Windows Phone上获得处理器计数。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM