Dim sc As New ServiceController If sc.Status = ServiceControllerStatus.StoppedSystem.ComponentModel.Win32Exception: Access is denied --- End of inner exception stack trace --- at
System.ServiceProcess.ServiceController.GetServiceHand
但是当我按照所有答案列出所有服务时,我会得到: 'ServiceController' does not contain a definition for 'GetServices' 我所有的研究都导致了}
{
ServiceController[] services = ServiceController.GetServ
我正在使用ServiceController类从C#程序集中远程关闭IIS.我想知道通过网络执行此操作所需的最低隐私级别是多少,在我当前的测试中,我使用的是Administrator,它工作得很好,但当我迁移到生产环境时ServiceController sc = new ServiceController(serviceName, serverName);
//Can we stop the
System.ComponentModel.Win32Exception: Access is denied at System.ServiceProcess.ServiceController.GetServiceHandle(Int32 desiredAccess) at System.ServiceProcess.S
您好,我试图通过.NET应用程序启动/停止/禁用windows服务,但我似乎无法获得以下代码工作,它一直在说错误4错误C2065:'ServiceController‘:未声明的标识符 if (controller.StatusServiceController^ controller = gcnew S