How to get the number of Processors on Windows Pho

2019-08-30 07:23发布

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

2条回答
你好瞎i
2楼-- · 2019-08-30 08:26

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.

查看更多
来,给爷笑一个
3楼-- · 2019-08-30 08:26

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.

查看更多
登录 后发表回答