简体   繁体   English

是否可以从Web服务启动Windows任务?

[英]is it possible to kick off a windows task from a webservice?

I have a web service and I'm wanting to create a method to kick off a windows task. 我有一个Web服务,我想创建一个启动Windows任务的方法。 Is this possible? 这可能吗? I've started by creating the windows task and then using the "when an event is logged". 我首先创建Windows任务,然后使用“记录事件时”。 I thought that this would be the option that I'd need, but not sure. 我认为这将是我需要的选项,但不确定。

Any help on where to get started would be great. 从何处开始的任何帮助都将非常有用。 Thanks, 谢谢,

If you are trying to use the Windows Task Scheduler you will have to work with the Task Scheduler COM interfaces described here . 如果尝试使用Windows Task Scheduler,则必须使用此处描述的Task Scheduler COM接口。 If you just want to start an executable you can use the System.Diagnostics.Process class to run the executable in a seperate process. 如果只想启动可执行文件,则可以使用System.Diagnostics.Process类在单独的进程中运行该可执行文件。

Have a look at the Task Scheduler Managed Wrapper . 看一下Task Scheduler托管包装器 I have used it before and thought it was very easy to work with. 我以前使用过它,并且认为使用它非常容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM