C#任务管理按执行顺序运行进程 [英] C# task management that runs processes in order of execution

查看:110
本文介绍了C#任务管理按执行顺序运行进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找出C#中的最佳方法,以允许我创建的网站远程启动服务器上的各种程序,但不能同时启动。我想通过.NET我可以创建一个程序,可以对网站上的各种按钮点击作出反应,然后填充程序将依次执行的列表。当每个过程完成时,它将变灰并被忽略,并执行下一个过程。我还希望能够为某个任务创建优先级,并且可以暂停所有任务或取消中断。非常感谢任何帮助!

I am trying to figure out the best approach in C# to allow a website that I have created to start up various programs on the server remotely, but not at the same time. I figured through .NET I could create a program that could react to various button clicks on the website, then populate a list that the program will execute in turn. As each process is finished it is grayed out and ignored and the next process is executed. I want to also be able to create priorities for certain task and an interrupt to either pause all task or cancel. Any help is very appreciated!

推荐答案

您是否考虑过使用Workflow库?如果你有,并且不认为它是合适的,那么看看我不久前在一起攻击的东西。它可能是你的起点。



ΝUnitInspiredTask Runner [ ^ ]



如前所述,代码构建了固定顺序的任务序列,它不会为您提供优先级或中断处理,因此将其用作它会减少创建任务序列,每个任务序列包含一个任务。我认为扩展以达到你想要的效果并不太难。
Have you considered using the Workflow library? If you have and don't think it's suitable then have a look at something I hacked together something a while ago. It might serve as a jumping off point for you.

ΝUnit Inspired Task Runner[^]

As outlined the code builds fixed order sequences of tasks and it doesn't give you priority or interrupt handling so using it as it stands would reduce to creating task sequences each containing a single tasks. I don't think it should be too difficult to extend to achieve what you want.


这篇关于C#任务管理按执行顺序运行进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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