How to get the number of Processors on Windows Phone

旧城冷巷雨未停 提交于 2019-12-11 15:41:15

问题


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


回答1:


According to this forum post, which links to the MSDN doc that you mentioned, you can't get the processor count programatically on Windows Phone.




回答2:


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.



来源:https://stackoverflow.com/questions/11400045/how-to-get-the-number-of-processors-on-windows-phone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!