问题描述
我正在一个项目中,我必须验证用于Intel Atom处理器和Windows 7 OS的平台.
我用过:ManagementClass mgmt = new ManagementClass("Win32_Processor");
//对于Intel Atom,对于Win 7 OS为"Win32_OperatingSystem"
现在,以管理员或标准用户身份登录时,此逻辑工作正常,但是以来宾用户身份登录时,我在方法中得到System.UnauthorizedAccessException
:void ThrowExceptionForHRInternal(Int32, IntPtr)
说明:拒绝访问
来宾帐户获取平台详细信息是否有任何限制?
谢谢,
Sandeep Sisodiya
I am working on a project where I have to validate the Platform for Intel Atom processor and Windows 7 OS.
I have Used:ManagementClass mgmt = new ManagementClass("Win32_Processor");
//for Intel Atom, "Win32_OperatingSystem" for Win 7 OS
Now, This Logic is working fine when login as Admin or Standard user, But When login as Guest User I am getting System.UnauthorizedAccessException
in method:void ThrowExceptionForHRInternal(Int32, IntPtr)
description: Access is denied
Is there any restriction for the Guest Account to fetch Platform details?
Thanks,
Sandeep Sisodiya
推荐答案
string arch = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE"); // AMD64
string archId = Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER"); // Intel64 Family 6 Model 23 Stepping 10, GenuineIntel
string archLevel = Environment.GetEnvironmentVariable("PROCESSOR_LEVEL"); // 6
string archRevision = Environment.GetEnvironmentVariable("PROCESSOR_REVISION"); // 170a
这篇关于来宾帐户限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!