By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,854 Members | 1,883 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,854 IT Pros & Developers. It's quick & easy.

Accessing the registry from a Web Service

P: n/a
I'm fairly new to this Web Service game so please feel free to suggest
something different if it looks like i'm completely off track!

I'm trying to write an application that runs on a Pocket PC that is
accessing data stored in a SQL server database on a seperate server
(not on the pocket pc). This wil be deployed to lots of customers sites
so I can't hard-code the location of the database in the program.

I wrote a seperate little app to enter and store the connection string
details in the registry so that they can be retrieved by the Web
Service to open the database and send the appropriate data to the
Pocket PC.

All works fine with accessing the registry if I run it from a test
windows app but as soon as I try to do the same from the Web Service I
get 'cannot access the registry' errors. Presumably this is down to
security issues?

Can I get round this with compromising the whole system security?
Should I really be storing the connection details in a config file
somewhere and if so, how would both apps (the one to set the details
and the WS to retireve them) know where this file was (without putting
it somewhere obvious like C:\)

Many thanks
Mark

Jan 5 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Mark,

The standard place for storing connection strings is indeed the
app/web.config file!

If you wish to use the registry, you must change the account that asp.NET is
running under to an account that has access to that registry key - either
change the ACL on the key or change the rights for the user account.

Martin.

<ma*********@gmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
I'm fairly new to this Web Service game so please feel free to suggest
something different if it looks like i'm completely off track!

I'm trying to write an application that runs on a Pocket PC that is
accessing data stored in a SQL server database on a seperate server
(not on the pocket pc). This wil be deployed to lots of customers sites
so I can't hard-code the location of the database in the program.

I wrote a seperate little app to enter and store the connection string
details in the registry so that they can be retrieved by the Web
Service to open the database and send the appropriate data to the
Pocket PC.

All works fine with accessing the registry if I run it from a test
windows app but as soon as I try to do the same from the Web Service I
get 'cannot access the registry' errors. Presumably this is down to
security issues?

Can I get round this with compromising the whole system security?
Should I really be storing the connection details in a config file
somewhere and if so, how would both apps (the one to set the details
and the WS to retireve them) know where this file was (without putting
it somewhere obvious like C:\)

Many thanks
Mark

Jan 7 '06 #2

P: n/a
But how do I hide those settings from prying eyes?

I've managed to encrypt (3DES) the settings into a byte array but if i
convert that to a string to write to the XML file, when i then convert
it back to a byte array to decrypt it, its complete nonsense!

Jan 16 '06 #3

P: n/a
If you search MSDN, there is a method for encrypting parts of the web.config
via REGIIS.exe - alternatively you may wish to look into the DPAPI.

As for your own 3DES not working, I suspect that you may have implemented it
incorrectly?

"mark.jerrom" <ma*********@gmail.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
But how do I hide those settings from prying eyes?

I've managed to encrypt (3DES) the settings into a byte array but if i
convert that to a string to write to the XML file, when i then convert
it back to a byte array to decrypt it, its complete nonsense!

Jan 16 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.