473,387 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

problem with impersonate

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
Jul 22 '05 #1
3 1458
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

Jul 22 '05 #2


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

Jul 22 '05 #3
You could also impersonate as needed :
http://support.microsoft.com/default...n-us;q306158#3

Patrice
--

"Yoshitha" <gu**********@rediffmail.com> a écrit dans le message de
news:eL**************@TK2MSFTNGP12.phx.gbl...
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

Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: paulp | last post by:
Greetings, I'm working on a CGI program that will run under MS IIS 5.0 and will browse folders on three other machines, building HTML pages that will provide links to these folders. ...
5
by: hellrazor | last post by:
HI there, I am developing a client side app which requires me to launch another program when a user clicks a button on a web page. I thought I'd create an asp.net page (using c# ) to accomplish...
7
by: Ram P. Dash | last post by:
Now this is a classic. The impersonation fails for CASE I but doesn't fail for CASE II or III. Case I: Client Side Code ----------------- System.Net.NetworkCredential credential = new...
1
by: Arda | last post by:
Hi all, I tried to connect a database(SQL) by both VS 2003 interface tools and normal typing. When I make the connection in subdirectory project it doesn't work and gives an error like this; ...
4
by: - Steve - | last post by:
I'm trying to change a user's password using objUser.Invoke("setPassword", "newpassword") It works fine as a console application if I'm logged in with someone with the correct permissions. If...
4
by: Nadav Popplewell | last post by:
Hi Everybody, I've got a problem debugging ASP.NET applications on an XP SP2 System. The Details: Up to now I've been developing on an XP SP1 computer. Several days ago I got a new computer...
3
by: Yoshitha | last post by:
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...
4
by: =?Utf-8?B?QmlsbCBNYW5yaW5n?= | last post by:
I have an internal ASP.NET 2.0 web service that does, among other things, expose a method that causes files to be written to a location that the user configures. The web service has been around...
1
by: JoeyNic | last post by:
I am working on an application where a web service (on the web tier) calls another web/gateway service (on the app tier). This then needs to save a file to a UNC share on a file server in our...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.