J
Jan Nielsen
I'm implementing a windows service using C# and dotnet. This service must be
able to be registered multiple times, and based on it's servicename I would
like to lookup parameters for the current instance in registry.
I think
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\myService\Parameters
would be the logical place to store these parameters. But I can't seem to
find a way to retrieve the servicename of the current instance of my
service.
I believe that if I had written this service in C, I could get the
servicename as it's passed as the first argument to the ServiceMain
function.
Is there a way to retrieve this information in a C# service ???
I've allready tried to to get this information from the arguments passed to
the OnStart function, but it seems like the first argument has been stripped
away.
Thanks in advance,
Jan Nielsen
able to be registered multiple times, and based on it's servicename I would
like to lookup parameters for the current instance in registry.
I think
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\myService\Parameters
would be the logical place to store these parameters. But I can't seem to
find a way to retrieve the servicename of the current instance of my
service.
I believe that if I had written this service in C, I could get the
servicename as it's passed as the first argument to the ServiceMain
function.
Is there a way to retrieve this information in a C# service ???
I've allready tried to to get this information from the arguments passed to
the OnStart function, but it seems like the first argument has been stripped
away.
Thanks in advance,
Jan Nielsen