473,385 Members | 1,341 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,385 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 1457
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.