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 / ASP.NET / Web Services / January 2006

Tip: Looking for answers? Try searching our database.

Accessing the registry from a Web Service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mark.jerrom@gmail.com - 05 Jan 2006 14:10 GMT
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
Martin Robins - 07 Jan 2006 12:22 GMT
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.

> 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!
[quoted text clipped - 22 lines]
> Many thanks
> Mark
mark.jerrom - 16 Jan 2006 16:02 GMT
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!
Martin Robins - 16 Jan 2006 21:08 GMT
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?

> 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!

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.