检测服务是否开启,参考
1、添加dll引用 System.ServiceProcess.dll
2、执行代码
Dim sc = System.ServiceProcess.ServiceController.GetServicesFor Each s As object In sc If s.ServiceName.ToLower = "mssqlserver" OrElse s.ServiceName.ToLower.indexof("mssql") >= 0 Then output.show(s.ServiceName) End IfNext