Hello,
I wrote a system service, whis is located in assembly called "s1.exe". But i
like to install this service twice. Problem starts, when service starts....a
service code loks like this:
public class TestService : ServiceBase
{
public TestService(string serviceName)
{
this.ServiceName = "????";
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
ServiceThread serviceClass;
protected override void OnStart(string[] args)
{
serviceClass = new ServiceThread(param);
}
protected override void OnStop()
{
if(serviceClass!=null)
serviceClass.Stop();
serviceClass = null;
}
public static void Main(string[] Args)
{
System.ServiceProcess.ServiceBase.Run(new
System.ServiceProcess.ServiceBase[] {new TestService(param)});
}
}
But there is one problem....how to make service know, what service name
should it have?
I've tried to use command line arguments, but i'm not unable to to pass this
(except the situation, when i start service manually...)
regards,
Pawel Janik