原文:http://blog.csdn.net/u010803748/article/details/53927977?locationNum=2&fps=1 一.判断指定程序名的进程是否存在 BOOL EnumWindows( WNDENUMPROC lpEnumFunc, // pointer to callback function LPARAM lParam // application-defined value); The EnumWindows function enumerate
一.压缩指定目录下的文件并删除原文件 #!/bin/bashZIP_DAY=7 function zip { local dir=$1 if [ -d $dir ];then local file_num=`ls -l $dir |grep "^d"|wc -l` if [ $file_num -ge $ZIP_DAY ];then local tar_name=`ls -lt $dir | grep -v *.tar.gz | grep -v total | head -n 1 |a
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Diagnostics; using System.Windows.Forms; namespace WindowsFormsApplication3 { pub
1. 直接遍历/proc目录 int find_pid_by_name( char* pidname, pid_t *pidlist) { #define READ_BUF_SIZE 256 DIR *dir; struct dirent *next; int i = 0; dir = opendir("/proc"); if (!dir) { printf("Cannot open /proc"); } while ((next = readdir(dir)) !
import win32com.client def check_exsit(process_name): WMI = win32com.client.GetObject('winmgmts:') processCodeCov = WMI.ExecQuery('select * from Win32_Process where Name like "%{}%"'.format(process_name)) if len(processCodeCov) > 0: return Tr