您当前的位置: 首页 >  windows

刘一哥GIS

暂无认证

  • 7浏览

    0关注

    918博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

C#使用ServiceController控制windows服务

刘一哥GIS 发布时间:2015-03-14 23:45:54 ,浏览量:7

    C#中,使用ServiceController类控制windows服务,使用之前要先添加引用:System.ServiceProcess,然后在命名空间中引用:using System.ServiceProcess。下面举例获取本机的所有已安装的Windows服务和应用,然后查找某一应用活服务是否已经安装。

代码:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.ServiceProcess;

namespace 判断机器中是否安装了某项服务或者应用
{
    public partial class Form1 :
关注
打赏
1663688642
查看更多评论
立即登录/注册

微信扫码登录

0.0490s