Click here to Skip to main content
15,891,621 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have Developed a Windows Service
and a ServiceController
which shows in system Tray Icon.
which contains Sart/Stop options to Alter the state of
the Service.

Here I want to add a functionality in the menu like
setting .When user clicks the settings
a window opens to input some Time inputs
means 1 hour 2 hour or a Specific time Like 10Am or any.
when user clicks ok after enetring the value.

I want that in The App.config xml file the parameters should
pass there and changes the configuration File Accordingly.
How to achieve this.
Can this Be done
Please suggest some Idea.
Posted
Comments
Member 13714562 9-May-18 1:26am    
I too am working on something like this. Would appreciate your help if you have found the solution.

1 solution

Hi ,
Right click on your solution Choose Properties Then Settings now you can add your variable in app.config and to access this
using C#
C#
string x = Properties.Settings.Default.Myvariable;

after you deploy your application go to set up file and modified it
Best Regards
M.Mitwalli
 
Share this answer
 
v2
Comments
Andy411 4-Oct-12 10:18am    
IMO that is not what the OP wants.
I think, he wants that the controller app can change settings which are read by the service itself during start.
The controller app will write the user settings part of the app.config in the current user directory. But the service has no access to the app.config of the controller app. The service runs as a diferent user (normally SYSTEM).
Or am I wrong?

The service settings need to be in a place, where the service and the controller app both have access.
Karwa_Vivek 5-Oct-12 1:07am    
Yes @Andy411 you are right.
I want to clear the Scenario more clear here
that when I am Installing the Windows Service.
The app.config File is placed in C drive under Program files
as Normally what haappens when we Install.

I have managed to read the app.config file using the External(Independent) service controller by hard Coding the Path of the app.config file. and fetched the service Interval value in a form . But Here Am struck as I am not getting any Idea to convert this value as 10am or any..My need is that to set the time such that service starts Daily or weekly at particular time or Day of the Week.am able to sart and stop the service from service control to but the Main problem is how to convert the service interval time to Day or particular time.

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