Hi,
I'm working on a window service and i want to give an interface to it. What can be the best approach to get this done.
Can i include a Form, when the user starts the service then gives some parameters only on the start. then the service is started and continue its work.
No need to give values on run-time.
Looking for best approaches.....................
Hi,
There are two different approaches to show an interface while windows service service is running.
1. Create a dll with a public method which invokes show method of a windows form and call the public method from OnStart event of windows service(Also add reference to the dll) .
2.Create a windows application and start it while windows service is being started and stop it while windows service is stopped.
Here is the sample code for the second option.
//Global variable
private System.Diagnostics.Process process;
---
---
---
protected override void OnStart(string[] args)
{
process = System.Diagnostics.Process.Start("WindowsApplicati on2.exe");
}
protected override void OnStop()
{
process.Kill();
}
Regards,
Balaji U