c# - Differentiating between Windows Services with the same name? -


i'm working on application interaction windows services. i'm using servicecontroller class handle interaction, i'm wondering happen if encounter 2 services same name.

in sample code provided in documentation, address services name, so:

foreach (servicecontroller sctemp in scservices)   if (sctemp.servicename == "simple service"){  /* work */ } 

i don't see stipulations requiring servicename unique. if 2 services named same, yet user wishes interact 1 of them, how handle this?

service names must unique, according createservice documentation:

error_duplicate_service_name

the display name exists in service control manager database either service name or display name.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -