sc.Pause()
Try
While sc.Status = ServiceControllerStatus.Paused
Threading.Thread.Sleep(1000)
sc.Refresh()
End While
Catch ex As Exception
End Try
大家好!
我遇到上述代码的问题。当sc.Pause()运行时,它给了我一个例外
'Cannot open Dhcp Service on computer '.' inner Exception Win32Exception: Access is denied
任何帮助表示赞赏!
谢谢,
Kyvex
我想出了一块拼图。我更改了app.manifest文件以运行
highestAvailable
现在它抛出一个例外
'Cannot pause Dhcp service on computer '.' Inner Exception Win32Exception: The request control is not valid for this service