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

Issues changing the value of an element in an array in matlab -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

vb.net - Alternative to the T-SQL AS keyword -