473,326 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Accessing the registry from a Web Service

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
3 1898
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ramesh | last post by:
hi, I have created COM when i try to use that instance in C#.net Wep application i am getting following error message. DBUsingCom is my Component name and BusinessObject as a Class name.can...
4
by: Jay | last post by:
Here lies my quandry: I have written a service that makes registry changes. The problem I run into is that, if I create the service under any account other than 'User' (i.e. 'LocalSystem',...
3
by: caldera | last post by:
Hi, I write a windows service. In that service I create a new subkey for registry. But service install is call CreateSubKey() the program throw an exception to the event log said that Cannot write...
4
by: Ashok | last post by:
Hello I need to programmatically change the permissions (ACL) on a specific registry key in a .NET app. Is there a way to do this in .NET? Thanks for the help, Ashok
0
by: Sharon McCarty | last post by:
Hi Everyone, I have a managed C++ web service and I'm trying to access the registry key that contains a binary data. Can someone tell me how to convert object __gc* to byte? I've got some...
2
by: Daniel Bass | last post by:
I've found this article on how to get ASP.Net to read/write from the server's registry, but it got heavily critted as being something that you should not do... ...
2
by: Stu | last post by:
Hi, I am storing various settings for a windows service in the registry - but for some reason the windows service will not read them. Namespaces: Imports System.ServiceProcess Imports...
2
by: Mostafa Salama | last post by:
i have a problem in accessing registry from web service i made a web service that call a function to access registry The web service contain the following code Dim RegKey As...
3
by: hisham123 | last post by:
I had windows xp 2002 service pack 2. i install vb6.0, crystal report 8.0, if i tried to access vb porjects references showing error accessing system registry could anybody give solution for this ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.