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

How to access Application.UserAppDataRegistry settings from a Windows service

P: n/a
Bob
I have a client app that writes a value to the registry (camera device ID).
I have used Application.CommonAppDataRegistry to write the value in my test
app.

How do I retrieve this data from a Windows service? Is the application
object accessible at all?

Cheers
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Bob
Just a correction - subject is incorrect - should be
CommonAppDataRegistry...

"Bob" <bo*@nospam.com> wrote in message
news:ud**************@TK2MSFTNGP09.phx.gbl...
I have a client app that writes a value to the registry (camera device ID). I have used Application.CommonAppDataRegistry to write the value in my test app.

How do I retrieve this data from a Windows service? Is the application
object accessible at all?

Cheers

Nov 20 '05 #2

P: n/a
Hi Bob,

The MSDN said,
If the key does not exist, it is created in the following format:
LocalMachine\Software\ CompanyName\ ProductName\ ProductVersion
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemwindowsformsapplicationclasscommonappda taregistrytopic.asp

Provided the client app is WindowsApplication18, the info will be stored in
the key path below.
HKLM\SOFTWARE\WindowsApplication18\WindowsApplicat ion18\1.0.1392.32335
You may try to use the registrykey class to restrieve the data from the key
above.
e.g.
[Client app]
Application.CommonAppDataRegistry.SetValue("hello" ,"world")

[Windows Service]
Dim str As String
Dim lm As RegistryKey
lm = Registry.LocalMachine
Dim rkey As RegistryKey =
lm.OpenSubKey("SOFTWARE\WindowsApplication18\Windo wsApplication18\1.0.1392.3
2335")
str = CType(rkey.GetValue("hello"), String)
rkey.Close()

If you have any question on this issue, please post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 20 '05 #3

P: n/a
Hi Bob,

Did my suggestion works for you?
If you have any question on this issue please post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.