ASP, read registry key

F

fabrice

hello,

Is it possible to read a registry key in ASP, and use the value in an
application via a session variable.
I'm using II6 on windows server 2003.

I'd like to create a key in the registry (under HKLM) and store a value
(connection string for example).
In the ASP application, read the value and store it in a session variable
with global.asa.

How do that and which right to access the regitry (IIS_IUSR) ?

Thanks a lot

fabrice
 
S

Steven Burn

Why on earth would you want to do this??????

You should NEVER store connection info in a session and should additionally, NEVER give IUSR_, write access to your registry!!.

Instead of doing it this way, either use an INI file or database (stored outside of the webroot), or re-think the way your application works (doesn't sound very secure so far).

How do I make my ASP pages more efficient
http://aspfaq.com/show.asp?id=2424

IniFiles(2)
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=8805&lngWId=4

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 
J

Jeff Cochran

Is it possible to read a registry key in ASP, and use the value in an
application via a session variable.
I'm using II6 on windows server 2003.

I'd like to create a key in the registry (under HKLM) and store a value
(connection string for example).
In the ASP application, read the value and store it in a session variable
with global.asa.

How do that and which right to access the regitry (IIS_IUSR) ?

Yuk!

Okay, maybe a little over-reacting there, but seriously, this is a
security nightmare and there are much better methods. You want to
store a connection sgtring in the registry for use. Why? Use it in
an include. It's easier to program it anyway and you don't need to
give IUSR permission to the registry. If you want, include it in a
global.asa file. But never the registry, that's not the place for
those things and it's certainly not a security risk you wnat.

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top