c# - How to get status of remote windows service -
i'm trying status of remote windows service. use code this, nothing happens. labels have not value. please!
connectionoptions options = new connectionoptions(); options.password = "password"; options.username = "username"; options.impersonation = system.management.impersonationlevel.impersonate; managementscope scope = new managementscope("\\\\computer_name\\root\\cimv2", options); scope.connect(); servicecontroller sc = new servicecontroller("service_name", "computer_name"); label1.text = sc.servicename; label2.text = sc.status.tostring();
Comments
Post a Comment