You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
992 B
39 lines
992 B
using System.ServiceModel;
|
|
using System.ServiceProcess;
|
|
|
|
namespace BatchCoreService
|
|
{
|
|
public partial class BatchCoreService : ServiceBase
|
|
{
|
|
public ServiceHost serviceHost = null;
|
|
public BatchCoreService()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
protected override void OnStart(string[] args)
|
|
{
|
|
if (serviceHost != null)
|
|
{
|
|
serviceHost.Close();
|
|
}
|
|
|
|
// Create a ServiceHost for the CalculatorService type and
|
|
// provide the base address.
|
|
serviceHost = new ServiceHost(typeof(DAService));
|
|
|
|
// Open the ServiceHostBase to create listeners and start
|
|
// listening for messages.
|
|
serviceHost.Open();
|
|
}
|
|
|
|
protected override void OnStop()
|
|
{
|
|
if (serviceHost != null)
|
|
{
|
|
serviceHost.Close();
|
|
serviceHost = null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|