Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have created a window service. Now I want to store a value permanently in it. So how can i do this?
Posted
Comments
Zoltán Zörgő 5-Sep-14 8:22am    
Why?

1 solution

A service is a service. It is an application that runs in background.
If you want to store something "in it" you need to modify the code.
But there is no "in it", as the service is an application, it is can be made of many kind of files. So you can have a configuration or data file aside the executable that you modify.
Or you can use the registry to store the value. If you speak about a runtime parameter, than the registry (HKLM) is the place for it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900