如何在特定时间段内执行c ++程序... [英] how to execute the c++ program for a specific period of time...

查看:98
本文介绍了如何在特定时间段内执行c ++程序...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何在特定时间段内执行c ++程序...

问候,
sanath

Hi,

How to execute the c++ program for a specific period of time...

regards,
sanath

推荐答案

Ctrl + Alt + Delete-> T 问经理…? :-)

或者也许通过System.Diagnostics.Process.Start运行它,它将返回System.Diagnostics.Process的实例.在父进程中,将System.Threading.Thread.Sleep用于所需的时间,然后他们使用此实例调用Process.Kill. :-)

请参阅 http://msdn.microsoft.com/en-us/library/system.diagnostics .process.aspx [ ^ ].

现在,您的问题是您不解释自己的最终目标.我几乎可以肯定,您永远不需要在特定时间段内执行C ++程序".你能解释为什么吗?

-SA
Ctrl+Alt+Delete -> Task Manager…? :-)

Or perhaps run it via System.Diagnostics.Process.Start which will return you the instance of System.Diagnostics.Process. In parent process, use System.Threading.Thread.Sleep for required amount of time and them call Process.Kill using this instance. :-)

See http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx[^].

Now, your problem is that you don''t explain your ultimate goal. I''m almost sure you never need to "execute the C++ program for a specific period of time". Could you explain why?

—SA


如果要在特定时间运行可执行文件,可以使用 ^ ] .您可以使用Windows随附的强大应用程序安排将批处理文件运行到脚本的可执行文件中.
或者,您可以使用 AT [ ^ ]命令从命令行安排任务.
In case you want to run an executable at a specific time, you can use Windows Scheduler[^]. You can schedule to run batch file to scripts to executables using this mighty application which comes along with Windows.

Or you can use AT[^] command to schedule a task from command line.


这篇关于如何在特定时间段内执行c ++程序...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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