需求:想通过C#代码来查看IIS服务或者MSMQ是否已经安装 分析:IIS服务和MSMQ安装完成后都会创建windows服务,所以我们只需要查看对应的服务是否存在即可. 准备工作: IIS服务名称:World Wide Web Publishing Service MSMQ服务名称:Message Queuing 代码实现: 1.创建一个类,用于检测服务是否存在: using System; using System.Collections.Generic; using System.Linq;…