?? procguard.h
字號(hào):
#ifndef ProcGuard_H_
#define ProcGuard_H_
//---------------------------------------------------------------------------
#define CFGFILE "../etc/procGuard.ini"
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <list>
#include <iostream>
#include "../class/iniFile.h"
#ifdef _WIN32
#include <windows.h>
#include <process.h>
#include <tlhelp32.h>
#else
#include <unistd.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#endif
using namespace std;
typedef struct
{
string strNam;
string strPath;
bool bRuning;
}tagProcInfo;
typedef struct
{
int iProcessId;
char acProcessName[128];
float fCpu;
float fMem;
}ProcessHealthStatus;
class CProcGuard
{
public:
CProcGuard();
~CProcGuard();
private:
string m_strTmpfName;
list<tagProcInfo *> m_lstProc;
vector<tagProcInfo *> m_arrProc;
int m_nProcess; // 進(jìn)程數(shù)目
int m_nDelaytm; // 等待延時(shí)(s)
private:
bool AddProc(string str);
bool StartupProc(tagProcInfo *pProc);
bool loadConfig();
public:
bool IsProcRuning(tagProcInfo *pProc);
void Run();
int ProcessWatch();
int ProcessHealthWatch(ProcessHealthStatus *pstProcessHealth,int *iCount);
int KillProcess(int iProcessId);
int IsNetActive();
int LinkTest(char *szLinkString,int iCount);
int DialWatch();
int m_nLinkType;
char m_strLinkType[256]; //CDMA,GRPS,ADSL,ETHERNET
char m_strLinkTest1[256];
char m_strLinkTest2[256];
};
//---------------------------------------------------------------------------
#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -