维斯塔+ VB.NET - 尝试从应用程序内启动/停止 Windows 服务时访问被拒绝
当我尝试启动/停止我创建的 Windows 服务时,我在 Vista 中收到以下错误。
Cannot open ServiceName service on computer '.'.
相同的代码适用于 XP。 我应该怎么做才能解决这个问题?
I get the following error in Vista while trying to start/stop a Windows Service that I created.
Cannot open ServiceName service on computer '.'.
The same code works for XP. What should I do to solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
用户帐户控制(又名 UAC)。 UAC表示用户不是以管理员身份运行。 您的应用程序需要告诉 Windows 它需要管理员权限。 我认为此页面比我更好地解释了这一点。
User Account Control (aka UAC). UAC means that the user is not running as an administrator. Your application needs to tell windows that it requires admin rights. I think this page explains it better than I can.
今天偶然发现你的问题,尽管你不久前就问过:)
当我尝试启动我开发的基于 .net 的服务时,我在 Windows Vista 上遇到了类似的问题。
我打开该服务的“属性”对话框,并将登录用户更改为本地系统(之前我尝试使用网络服务启动该服务)。 重新启动服务时我没有收到任何错误。
如果您仍然想知道答案,这对我有用。 我希望它也对你有用。
干杯!
Just stumbled upon your question today, though you had asked it a while back :)
I was having a similar problem on Windows Vista while i was trying to start a .net based service that i had developed.
I opened the Properties dialog of the service and changed the Log On user to Local System (Previously i was trying to start the service using Network Service). On restarting the service i didn't get any error.
In case you are still wondering about the answer, this has worked for me. I hope it will work for you too.
Cheers!