Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / September 2005

Tip: Looking for answers? Try searching our database.

programatically how to set the steps involved in enabling the ASP.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dur - 30 Sep 2005 10:28 GMT
Hi all,
I am facing one problem while  generating the entries in the EventLog in
ASP.NET.
That error is " registry access is  not allowed". So i found some code in
the google regarding registry access. So i followed it and finally  working
well.

I set those permissions manually(Not programmatically). But i want it
programatically. The steps are given below.

Can you help me how to set the below steps programmatically.

1. Launch RegEdit
2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\
   CurrentControlSet\Services\EventLog\
3. From the menu, select Edit->Permissions
4. Click the Add button and write ASPNET.  (if ASP.NET is running under a
different user id, use that id instead)
5. Click OK.
6. Select the newly added user from the list (ASP.NET Machine User by
default).
7. Click on Full Control in the Allow column.
8. Click OK.

It is usually a good idea at this point to restart IIS with the IISReset
command (Start | Run | IISReset).

regards
Srihari k
Kevin Spencer - 30 Sep 2005 14:16 GMT
You're barking up the wrong tree, Srihari. You can't modify the Registry if
you don't have permission to use the Registry.

You certainly can modify the Registry programmatically, using the
Microsoft.Win32 .Registry and Microsoft.Win32.RegistryKey classes, but
again, you wouldn't be able to if you don't have permission.

You CAN use the WindowsIdentity class (and some unmanaged code) to
impersonate a user account that has whatever permissions your app needs, as
long as you know the domain, user name, and password for that account. See:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fsystemsecurityprincipalwindowsidentityclassimpersonatetopic.asp


Signature

HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Big things are made up of
lots of little things.

> Hi all,
> I am facing one problem while  generating the entries in the EventLog in
[quoted text clipped - 26 lines]
> regards
> Srihari k

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.