473,545 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="tr ue" 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 1470
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="tr ue" 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_Process or")

Dim moc As ManagementObjec tCollection = mc.GetInstances ()

Dim mo As ManagementObjec t

For Each mo In moc

If cpuInfo = String.Empty Then cpuInfo =
mo.Properties(" ProcessorId").V alue.ToString()

Next

Return cpuInfo

End Function

and am getting error in this line

Dim moc As ManagementObjec tCollection = mc.GetInstances ()

system.manageme nt.managementex ception Access Denied.



"Stuart" <St****@discuss ions.microsoft. com> wrote in message
news:7B******** *************** ***********@mic rosoft.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="tr ue" 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**********@r ediffmail.com> a écrit dans le message de
news:eL******** ******@TK2MSFTN GP12.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="tr ue" 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
2047
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. Essentially, the CGI will connect to each machine in turn, doing the FindFirst/FindNext process based on the current criteria. It will select certain...
5
7401
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 this. After much research I found that it's not that simple. The asp process runs under an aspnet user, which does not let me launch my program. I...
7
1828
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 System.Net.NetworkCredential("myUserName", "myPassword", "myDomain"); ServiceA a = new ServiceA();
1
3665
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; Server Error in '/WebApplication1' Application. ----------------------------------------------------
4
2329
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 I'm logged in as a normal user it doesn't work, even though call before that, objUser.Username = "admin@domain.com" objUser.Password =...
4
1540
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 with XP SP2 installed. I moved the ASP.NET to the new computer (got the source from source safe and compiled on that computer), and i've run into...
3
252
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 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...
4
1629
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 for a while, under ASP.NET 1.0 and it has just been updated to ASP.NET 2.0. The functionality in question has not changed. When testing the...
1
3057
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 internal network. The issue that I'm having is that as our app tier is not on a domain, I am unable to impersonate a domain account to access the...
0
7486
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7676
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7932
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
4965
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3473
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3456
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1905
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1032
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
729
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.