Wrox Programmer Forums
|
BOOK: Professional VB.NET, 2nd Edition or 2003
This is the forum to discuss the Wrox book Professional VB.NET, 2nd Edition by Fred Barwell, Richard Case, Bill Forgey, Billy Hollis, Tim McCarthy, Jonathan Pinnock, Richard Blair, Jonathan Crossland, Whitney Hankison, Rockford Lhotka, Jan D. Narkiewicz, Rama Ramachandran, Matthew Reynolds, John Roth, Bill Sheldon, Bill Sempf; ISBN: 9780764544002
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional VB.NET, 2nd Edition or 2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 18th, 2003, 12:00 PM
IM IM is offline
Registered User
 
Join Date: Jun 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Reading Windows Registry

Hi,

I am running Win2003 server
I have a 'ServicedComponent' activated as a Library app.
I call the method in the component that reads the registry.

If I call the method from Windows (tester) app it returns results, but if I call the method from ASP.NET application it returns nothing.

I assigned the 'Read' permission to the 'IUSR_<MACHINE_NAME>' user using regedit.exe, but the problem remains.

What am I missing here

TIA,
IM
 
Old July 2nd, 2003, 04:45 PM
Authorized User
 
Join Date: Jun 2003
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to JonathanC
Default

Hi Tia

It is not the IUSR_<MACHINE_NAME> that you should be looking at.
It is the ASP.NET user account.

There are many things that could prevent this, so purely as a aid in you finding the right article or faq entry, here is a simple explanation

Check in your web.config file and in IIS properties for your authentication settings
If it is anonymous and you are not using windows authentication, your webpage will run as ASPNET user.
If you are running under Windows Authentication and impersonation set to true, it will run as the user that browses your webpage.
Your test application is running as "you" with your security policy and therefore it is likely that it will work. ASP.NET works differently, as described above.

In all these cases the permissions must be set for the appropriate user.

If you would like to make sure and see for yourself.
look at the code snippet below.

string name = System.Security.Principal.WindowsIdentity.GetCurre nt().Name;

Look at the value assigned to "name" and it will tell you who the account is.

in your registry editor (regedit)
navigate to :
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Servic es\EventLog

Click Edit | Permissions on the menu with the EventLog node selected
and add the user and permissions you want for the user you obtained from the code snippet.

I hope this helps.


Jonathan Crossland
http://www.jonathancrossland.com
 
Old July 10th, 2003, 02:13 PM
IM IM is offline
Registered User
 
Join Date: Jun 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Jonathan,

I tried this code:

name = System.Security.Principal.WindowsIdentity.GetCurre nt().Name

The "name" returns "IUSR_<MACHINE_NAME>".

Then I edited registry exactly as you suggested,
but I still have the same problem.


Tnank you,
IM





Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows registry ivanlaw Pro VB 6 7 November 19th, 2007 12:41 PM
Windows Registry kumar_rajeshk Pro VB 6 6 April 29th, 2004 01:08 AM
Scheduled Task Reading Registry ritag VB How-To 2 November 5th, 2003 03:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.