Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/351.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何调用.NET';Python中的s ServiceBase.OnCustomCommand方法?_C#_Python_.net_Wcf_Windows Services - Fatal编程技术网

C# 如何调用.NET';Python中的s ServiceBase.OnCustomCommand方法?

C# 如何调用.NET';Python中的s ServiceBase.OnCustomCommand方法?,c#,python,.net,wcf,windows-services,C#,Python,.net,Wcf,Windows Services,我有一个Windows服务(使用.NET4.7.2,per中的C),它实现了ServiceBase.OnCustomCommand() 我有一个Python3.6脚本,需要调用OnCustomCommand方法。如何从Python调用OnCustomCommand 我看的地方 我看到Python已经实现了,但它似乎没有实现OnCustomCommand。我可能错了 我想出的最佳解决方案 从中可以看出,我可以使用sc控件。我目前的最佳解决方案是使用以下内容: import os os.syste

我有一个Windows服务(使用.NET
4.7.2
,per中的C),它实现了
ServiceBase.OnCustomCommand
()

我有一个Python
3.6
脚本,需要调用
OnCustomCommand
方法。如何从Python调用
OnCustomCommand


我看的地方

我看到Python已经实现了,但它似乎没有实现
OnCustomCommand
。我可能错了

我想出的最佳解决方案

从中可以看出,我可以使用
sc控件
。我目前的最佳解决方案是使用以下内容:

import os
os.system('sc control MyService 42`) 

提前感谢您的帮助