windows - 服务 Controller 无法启动服务 - 访问被拒绝

标签 windows

我正在 win 表单应用程序中使用服务 Controller 来启动和停止监听消息队列并处理消息的服务。当从 win forms 应用程序启动服务时,我收到访问被拒绝错误。我使用的是 Vista Home Basic 和一个管理员类型的帐户,并且我使用了“登录为 - 本地系统帐户”。可以使用服务管理控制台正常启动和停止该服务,但当我尝试以编程方式启动该服务时出现错误。有人可以提供一些有关如何解决此问题的指导吗?

最佳答案

可能您在打开服务控制台时已经提升了权限,但不是您自己的应用程序。

添加“应用程序 list 文件”(即 Visual Studio 中模板的名称)并将请求的执行级别设置为“requireAdministrator”( list 文件中的注释会有所帮助)。

关于windows - 服务 Controller 无法启动服务 - 访问被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/490772/

相关文章:

c# - 通用 Windows 平台和 SignalR(无法加载文件或程序集“System.Net,版本 = 2.0.5.0”)

windows - 如何让Internet Explorer在某个域自动登录

python - 在 Windows 上检测插入的 USB

python - python代码平台独立吗?

c++ - 使用 SDL2 和 MinGW 诊断 DLL 问题

windows - Qt creator Debug模式真的很慢

python - Windows 错误(3, 'The system cannot find the path specified' )

windows - 如何修复 ‘--go_out: protoc-gen-go: The system cannot find the file specified.’ 错误

c++ - 从(开放的)Solaris 交叉编译到 Windows?

windows - -webkit-backface-visibility 在 Windows 上的 node-webkit 中不起作用