How to detect if a service is running or not
-
Hello gurus, As the subject says, I'd like to know how I can detect if a service is running in C#? Is there an equivalent of the vb script
IsServiceRunning
function in C#??? Can someone provide me a code snipet please? Best regards. Fred.There is no spoon.
-
Hello gurus, As the subject says, I'd like to know how I can detect if a service is running in C#? Is there an equivalent of the vb script
IsServiceRunning
function in C#??? Can someone provide me a code snipet please? Best regards. Fred.There is no spoon.
Hi, ServiceController.Status give the status of the service. I guess you can use this. Thanks and Regards Mahe
-
Hello gurus, As the subject says, I'd like to know how I can detect if a service is running in C#? Is there an equivalent of the vb script
IsServiceRunning
function in C#??? Can someone provide me a code snipet please? Best regards. Fred.There is no spoon.
using system.serviceprocess // u have to add a dll file System.ServiceProcess.ServiceController svcCtrl = new ServiceController("your service name "); string mystatus=svcCtrl.status.ToString(); Console.Writeline(mystatus);
-
using system.serviceprocess // u have to add a dll file System.ServiceProcess.ServiceController svcCtrl = new ServiceController("your service name "); string mystatus=svcCtrl.status.ToString(); Console.Writeline(mystatus);