📄 delete_winevtlog.cpp
字号:
#include <windows.h>
#include <stdio.h>
void main()
{
HANDLE hAppEventLog,hSysEventLog,hSecEventLog;
BOOL clrAppEvent,clsAppEvent,clrSysEvent,clsSysEvent,clrSecEvent,clsSecEvent;
hAppEventLog=OpenEventLog(NULL,"Application");
hSysEventLog=OpenEventLog(NULL,"System");
hSecEventLog=OpenEventLog(NULL,"Security");
if (hAppEventLog==NULL||hSysEventLog==NULL||hSecEventLog==NULL)
printf("OpenEvent Failed");
clrAppEvent=ClearEventLog(hAppEventLog,NULL);
clrSysEvent=ClearEventLog(hSysEventLog,NULL);
clrSecEvent=ClearEventLog(hSecEventLog,NULL);
if(clrAppEvent==0||clrSysEvent==0||clrSecEvent==0)
printf("ClearEvent Failed");
clsAppEvent=CloseEventLog(hAppEventLog);
clsSysEvent=CloseEventLog(hSysEventLog);
clsSecEvent=CloseEventLog(hSecEventLog);
if (clsAppEvent==0||clsSysEvent==0||clsSecEvent==0)
printf("CloseEvent Failed");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -