i wrote the following code to get the cpu id
Public Function GetCPUId() As String
Dim cpuInfo As String = String.Empty
Dim temp As String = String.Empty
Dim mc As ManagementClass = New ManagementClass("Win32_Processor")
Dim moc As ManagementObjectCollection = mc.GetInstances()
Dim mo As ManagementObject
For Each mo In moc
If cpuInfo = String.Empty Then cpuInfo =
mo.Properties("ProcessorId").Value.ToString()
Next
Return cpuInfo
End Function
and am getting error in this line
Dim moc As ManagementObjectCollection = mc.GetInstances()
system.management.managementexception Access Denied.
"Stuart" <St****@discussions.microsoft.com> wrote in message
news:7B**********************************@microsof t.com...
Hello Yoshita,
Could you copy the code snippet you are using to get the CPUID.
Stuart
"Yoshitha" wrote:
Hi
I've to access registry and also get cpu id from the web application.
First i wrote code to get cpuid from web application then i got cpu id.
Next i wrote code to set value into a registry and when ran the
application i got error that access to Registry is denied some thing.
and then what i did is i changed the impersonate="true" from false in
identity section of the machine.confog file.
and then ran the application then i successfully placed the value into
the registry, but i couldnt get the cpu id.
again icnaged the impersonate to false now it is working for cpu id and
not for registry.
Can anybody tell me the solution for my problem.
i've to access registry and also get cpuid how can i achieve this.
Its very urgent for me
Thanx in advance
Yoshitha