C # Checks If Windows has a method for installing a service

Source: Internet
Author: User

The example in this article describes how C # checks whether Windows has a service installed. Share to everyone for your reference. Specific as follows:

The C # code is as follows:

public static void Iswindowsserviceinstalled (String serviceName) {  //Get list of Windows services  servicecontroller[] Services = Servicecontroller.getservices ();  foreach (ServiceController service in services)  {    if (service. ServiceName = = ServiceName)      return true;  }  return false;}

I hope this article is helpful to everyone's C # programming.

In addition to the Declaration, Running GuestArticles are original, reproduced please link to the form of the address of this article
C # Checks If Windows has a method for installing a service

This address: http://www.paobuke.com/develop/c-develop/pbk23112.html






Related Content C # mask due to crash popup windows exception bullet box WinForm implemented picture drag and zoom function Example C # string sorted by ASCII method based on C # Implementation of simple random draw small program
C # Implementation of the method of decomposing a matrix into the sum of symmetric and inverse matrices C # Encrypt the connection string in app. C # using a delegate implementation of a fast sort algorithm example C # Implementation of a JSON string processing instance

C # Checks If Windows has a method for installing a service

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.