c ++程序中的系统重新启动已解决的问题 [英] system restart releted problem in c++ program

查看:86
本文介绍了c ++程序中的系统重新启动已解决的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此程序中,我正在检查由网页创建的restart.xml文件,在网页中,按下此按钮后我有一个重新启动按钮,如果我们的cpp程序得到此restart.xml文件,则会创建restart.xml将重新启动系统.但我不希望它每次都检查.

in this program i am checking a restart.xml file which is create by web page, in web page i have a restart button after pressing this button it create restart.xml if our cpp program get this restart.xml file then it will restart the system. but i don''t want it check every time. it should check only one time when if found this restart.xml file.

推荐答案

在ur cpp解决方案中,有一个线程查找restart.xml文件,该线程仅应检查一次.每5秒钟左右查找一次此文件的存在.
一旦您的线程通知存在,请尝试重新启动您的计算机.
Have in ur cpp solution, a thread which looks for the restart.xml file, which looks for the existence of this file after each 5 sec or so.
Once ur thread notifies the existence, try restarting ur machine.


有一个名为ReadDirectoryChange [
there is api called ReadDirectoryChange [http://msdn2.microsoft.com/en-us/library/aa365465(VS.85).aspx[^], have a look!


这篇关于c ++程序中的系统重新启动已解决的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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