重新启动计算机后如何保持运行 [英] how to keep running after restart the computer

查看:279
本文介绍了重新启动计算机后如何保持运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要MFC对话程序.它可能像一个计数器:每30秒重新启动计算机,然后记录循环时间并继续.但是我不知道如何在重新启动系统后保存程序并恢复程序.

I want to MFC dialog program. it maybe like a counter: every 30 seconds restart the computer then record the loop times and go on. but I have no idea how to save the program and recovery it after restart the system.

推荐答案

好吧,假设该程序用于性能统计"目的且有效要做的事情(与某些令人讨厌的病毒相对)

您可以安排重新启动时将程序作为系统服务自动启动(在MSDN上找到API,使用控制面板创建服务).

在强制重新启动之前,请将轨道保留在已知位置(文件或注册表)中,以便您可以在重新启动时进行处理.

学生练习:

1)初始条件,以前没有重新启动,因此在首次使用时没有统计信息.
2)停止无限重启循环.
Well, assuming this program is for "performance statistics" purposes and a valid thing to do (as opposed to some annoying virus)

You could arrange to have your program automatically start as a system service on re-boot (find the APIs on MSDN, use the Control Panel to create services).

Prior to forcing a reboot, leave tracks in a known location (a file or the Registry) so that you can do your processing on restart.

Exercises for the student:

1) initial conditions, no previous re-boot so no statistics on first use.
2) stopping the infinite re-boot loop.


这篇关于重新启动计算机后如何保持运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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