Service project

  • Thread starter Thread starter Curious
  • Start date Start date
C

Curious

I have a .NET project whose final products are two background services
that you can see, start, or stop in the "Services" panel.

I have a folder containing the executables in the form of .dll
and .exe. How can I use the executables to start the services?
 
Curious said:
I have a .NET project whose final products are two background services
that you can see, start, or stop in the "Services" panel.

I have a folder containing the executables in the form of .dll
and .exe. How can I use the executables to start the services?

You have to use the .Net Framework Service Controller in code.
 
They're both defined as sub-classes of
"System.ServiceProcess.ServiceBase". I've built the executables. But
don't know how to get the services started.
 
Curious said:
They're both defined as sub-classes of
"System.ServiceProcess.ServiceBase". I've built the executables. But
don't know how to get the services started.

This is how I have done it which works the same way in VB or C#.Net

Dim theServiceController as System.ServiceProcess.ServiceController
me.theServiceController = New System.ServiceProcess.ServiceController()
me.theServiceController.MachineName = "Curious"
me.theServiceController.ServiceName = "CuriousService"

if (theServiceController.Status = ServiceControllerStatus.Stopped) then
theServiceController.Start()
end if
 
Back
Top