在应用程序启动时禁用Windows服务 [英] Disable Windows service at application launch
本文介绍了在应用程序启动时禁用Windows服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
由于 VLC冲突我必须关闭Windows我的应用程序启动时的高级文本服务.有什么特殊的API吗?它将对具有默认权限的用户有效吗?
Because of VLC conflict I have to turn off Windows Advanced Text Services at my application launch. Is there any special API for that? Will it work for user with default rights?
推荐答案
ServiceController _ServiceController = new ServiceController([NameService]);
if (!_ServiceController.ServiceHandle.IsInvalid)
{
_ServiceController.Stop();
_ServiceController.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromMilliseconds(uConstante.CtTempoEsperaRespostaServico));
}
这篇关于在应用程序启动时禁用Windows服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文