目前状态:
1、what user the thread is executing as: TONGLN\ASPNET
2、web.config中
<system.web>
<identity impersonate="true"/>
3、计算机管理中的ASPNET隶属于administrators、debugger users
我把web.config更改成
<system.web>
<identity impersonate="true" username=administrator password=1234/>
后系统未出错,执行结果:The central processor of this machine is:GenuineIntel
程序代码为:
Response.Write(System.Security.Principal.WindowsIdentity.GetCurrent().Name);
// Create a new key under HKEY_LOCAL_MACHINE\Software as MCBInc
RegistryKey key = Registry.LocalMachine.OpenSubKey("Software", true);
// Add one more sub key
RegistryKey newkey = key.CreateSubKey("MCBInc");
// Set value of sub key
newkey.SetValue("MCBInc", "NET Developer");
// Retrieve data from other part of the registry
// find out your processor
RegistryKey pRegKey = Registry.LocalMachine;
pRegKey = pRegKey.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
Object val = pRegKey.GetValue("VendorIdentifier");
Response.Write ("The central processor of this machine is:"+ val);
请指教!