91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

功能:對指定的Exe程序進行守護,防止程序因為一些意外情況掛死。程序啟動后每隔2s檢測指定程序是否處于正常運行狀態,如不是,則重啟

資源截圖

代碼片段和文件信息

#include?“CheckThread.h“

#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?

BOOL?IsExistProcess(const?char*??szProcessName)
{
????PROCESSENTRY32?processEntry32;
????HANDLE?toolHelp32Snapshot?=?CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS?0);
????if?(((int)toolHelp32Snapshot)?!=?-1)
????{
????????processEntry32.dwSize?=?sizeof(processEntry32);
????????if?(Process32First(toolHelp32Snapshot?&processEntry32))
????????{
????????????do
????????????{
????????????????int?iLen?=?2?*?wcslen(processEntry32.szExeFile);
????????????????char*?chRtn?=?new?char[iLen?+?1];
????????????????//轉換成功返回為非負值
????????????????wcstombs(chRtn?processEntry32.szExeFile?iLen?+?1);
????????????????if?(strcmp(szProcessName?chRtn)?==?0)
????????????????{
????????????????????return?TRUE;
????????????????}
????????????}?while?(Process32Next(toolHelp32Snapshot?&processEntry32));
????????}
????????CloseHandle(toolHelp32Snapshot);
????}
????//
????return?FALSE;
}

CheckThread::CheckThread(Qobject?*parent)
????:?QThread(parent)
?????_state(true)
{

}

CheckThread::~CheckThread()
{
????quit();
????wait();
}

void?CheckThread::runStateChgSlot(bool?state)
{
????qDebug()?<????_state?=?state;
}

void?CheckThread::run()
{
????QSettings?sets(“sys.ini“?QSettings::IniFormat);
????QString?exeAbsPath?=?sets.value(KEY_EXE_PATH).toString();
????QString?exeName?=?exeAbsPath.split(‘/‘).last();
????//?檢測程序是否還在運行
?????while?(1)?{
?????????if?(_state?&&?!IsExistProcess(exeName.toStdString().c_str()))?{
?????????????QString?loginfo;
?????????????loginfo?+=?QDateTime::currentDateTime().toString(“yyyy-MM-dd?hh:mm:ss“);
?????????????loginfo?+=?“|“;
?????????????loginfo?+=?exeName;
?????????????loginfo?+=?“|“;
?????????????loginfo?+=?“restart\n“;
?????????????QFile?file(“restart_recored.txt“);
?????????????file.open(QIODevice::WriteOnly?|?QIODevice::Text?|?QIODevice::Append);
?????????????QTextStream?out(&file);
?????????????out?<?????????????file.close();
?????????????system(exeAbsPath.toStdString().c_str());
?????????}?else?{

?????????}

?????????Sleep(2000);
?????}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-01-17?09:53??VerSysProtector\
?????目錄???????????0??2019-01-17?09:56??VerSysProtector\build-VerSysProtector-msvc-Release\
?????文件????????1169??2019-01-11?15:34??VerSysProtector\build-VerSysProtector-msvc-Release\.qmake.stash
?????目錄???????????0??2019-01-11?15:34??VerSysProtector\build-VerSysProtector-msvc-Release\debug\
?????文件???????31073??2019-01-17?09:56??VerSysProtector\build-VerSysProtector-msvc-Release\Makefile
?????文件???????53022??2019-01-17?09:56??VerSysProtector\build-VerSysProtector-msvc-Release\Makefile.Debug
?????文件???????53028??2019-01-17?09:56??VerSysProtector\build-VerSysProtector-msvc-Release\Makefile.Release
?????目錄???????????0??2019-01-17?09:56??VerSysProtector\build-VerSysProtector-msvc-Release\release\
?????文件?????3466856??2014-03-11?18:54??VerSysProtector\build-VerSysProtector-msvc-Release\release\D3Dcompiler_47.dll
?????目錄???????????0??2019-01-16?19:40??VerSysProtector\build-VerSysProtector-msvc-Release\release\Icon\
?????目錄???????????0??2019-01-11?15:37??VerSysProtector\build-VerSysProtector-msvc-Release\release\iconengines\
?????文件???????31232??2017-12-01?00:43??VerSysProtector\build-VerSysProtector-msvc-Release\release\iconengines\qsvgicon.dll
?????文件???????10654??2019-01-16?19:39??VerSysProtector\build-VerSysProtector-msvc-Release\release\Icon\run.jpg
?????文件???????14779??2019-01-16?19:39??VerSysProtector\build-VerSysProtector-msvc-Release\release\Icon\stop.jpg
?????目錄???????????0??2019-01-11?15:37??VerSysProtector\build-VerSysProtector-msvc-Release\release\imageformats\
?????文件???????26112??2017-11-30?22:34??VerSysProtector\build-VerSysProtector-msvc-Release\release\imageformats\qgif.dll
?????文件???????33280??2017-12-01?00:34??VerSysProtector\build-VerSysProtector-msvc-Release\release\imageformats\qicns.dll
?????文件???????26624??2017-11-30?22:34??VerSysProtector\build-VerSysProtector-msvc-Release\release\imageformats\qico.dll
?????文件??????297472??2017-11-30?22:35??VerSysProtector\build-VerSysProtector-msvc-Release\release\imageformats\qjpeg.dll
?????文件???????21504??2017-12-01?00:42??VerSysProtector\build-VerSysProtector-msvc-Release\release\imageformats\qsvg.dll
?????文件???????20992??2017-12-01?00:33??VerSysProtector\build-VerSysProtector-msvc-Release\release\imageformats\qtga.dll
?????文件??????327680??2017-12-01?00:34??VerSysProtector\build-VerSysProtector-msvc-Release\release\imageformats\qtiff.dll
?????文件???????19968??2017-12-01?00:34??VerSysProtector\build-VerSysProtector-msvc-Release\release\imageformats\qwbmp.dll
?????文件??????401408??2017-12-01?00:35??VerSysProtector\build-VerSysProtector-msvc-Release\release\imageformats\qwebp.dll
?????文件???????13312??2017-11-30?22:11??VerSysProtector\build-VerSysProtector-msvc-Release\release\libEGL.dll
?????文件?????1950720??2017-11-30?22:11??VerSysProtector\build-VerSysProtector-msvc-Release\release\libGLESV2.dll
?????文件????15995904??2016-06-14?21:08??VerSysProtector\build-VerSysProtector-msvc-Release\release\opengl32sw.dll
?????目錄???????????0??2019-01-11?15:37??VerSysProtector\build-VerSysProtector-msvc-Release\release\platforms\
?????文件?????1155072??2017-11-30?22:37??VerSysProtector\build-VerSysProtector-msvc-Release\release\platforms\qwindows.dll
?????文件?????4833792??2019-01-11?15:37??VerSysProtector\build-VerSysProtector-msvc-Release\release\Qt5Core.dll
?????文件?????5146624??2017-11-30?22:21??VerSysProtector\build-VerSysProtector-msvc-Release\release\Qt5Gui.dll
............此處省略41個文件信息

評論

共有 條評論