使用.Net类控制服务 [英] Controlling a Sevice with .Net classes

查看:55
本文介绍了使用.Net类控制服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我用VB.Net编写的应用程序中,我有一个服务和一个桌面控制器.控制器会定期启动,停止并进行状态查询.我在30秒内启动控制器并进行状态查询时遇到了问题 并在不同的时间内成功执行此操作,然后失败状态查询功能.多次成功执行同一操作后,将发生故障.电话是:

I have a service and a desktop controller in my application written in VB.Net. The controller starts, stops and does status inquiries on a regular basis. I have had problems with the controller starting the service and doing status inquiry on a 30 second basis and doing so successfully for varying amounts of time and then failing on the status inquiry function. The failure occurs after doing the same operaton successfully many times. The call is:

我在状态参考上收到此错误:

I get this error on the Status reference:

System.InvalidOperationException:无法在计算机."上打开云打印服务"服务. ---> System.ComponentModel.Win32Exception:指定的服务不作为已安装的服务存在---内部异常堆栈跟踪的结尾---在System.ServiceProcess.ServiceController.GetServiceHandle(Int32 System.ServiceProcess.ServiceController.GenerateStatus()的System.ServiceProcess.ServiceController.get_Status()的期望的访问)

System.InvalidOperationException: Cannot open Cloud Print Service service on computer '.'. ---> System.ComponentModel.Win32Exception: The specified service does not exist as an installed service --- End of inner exception stack trace --- at System.ServiceProcess.ServiceController.GetServiceHandle(Int32 desiredAccess) at System.ServiceProcess.ServiceController.GenerateStatus() at System.ServiceProcess.ServiceController.get_Status()

如果我使用错误的名称或未实际安装该服务,则在第一次调用ServiceController函数时,此错误才有意义...但这会在多次调用这些函数后发生.另外,为什么引用通过Status属性成功 失败.没道理.

This error would make sense on the first call to ServiceController functions if I had the wrong name or the service was not actually installed...but this happens after many calls to these functions. Also, why does the referesh succeed by the Status property fail. It makes no sense.

推荐答案

理查德,

您是说您无法打开Goog​​le云打印服务吗?如果是这样,请在Google论坛上发布您的问题.它不在我们的支持范围内.

Did you mean you cannot open Google Cloud Print Service? If so, please post your question on google forum. It’s out of our support range.

为节省您的时间,请查看以下链接以获取有关其详细信息. https://support.google.com/chrome/answer/1069693?hl=zh_CN .

To save your time, please check the following link for details about it. https://support.google.com/chrome/answer/1069693?hl=en.

如果我误会了,请告诉我.

Please let me know if I misunderstand.

此致


这篇关于使用.Net类控制服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆