VC++ 监视文件(夹)
参考:http://www.cnblogs.com/fangkm/archive/2009/03/31/1426526.html
WinFileSystemMonitor.h
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
#pragma once
// 文件目录改变的类型 //定义文件/目录改变后的回调函数指针 class CWinFileSystemMonitor public: /* /* /* /* private: //继续监视 //监视线程处理函数 }; |
WinFileSystemMonitor.cpp
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
#include "WinFileSystemMonitor.h"
CWinFileSystemMonitor::CWinFileSystemMonitor(void) CWinFileSystemMonitor::~CWinFileSystemMonitor(void) void CWinFileSystemMonitor::SetDealFilePtr(lpFunDealFile pFunDeal) BOOL CWinFileSystemMonitor::StartMonitor( LPCTSTR lpszDir ) HANDLE hDir = ::CreateFile(lpszDir, m_hDir = hDir; void CWinFileSystemMonitor::EndMonitor() ::CloseHandle(m_hDir); } BOOL CWinFileSystemMonitor::IsMoniting() DWORD WINAPI CWinFileSystemMonitor::MonitorProc( LPVOID lParam ) }; while( pThis->m_bContinue ) != pNotify->NextEntryOffset) ; void CWinFileSystemMonitor::ActionProcess( tagACTION action, LPCTSTR lpszFileSrc, LPCTSTR lpszFileDst ) |
一个Demo,仅供参考,欢迎改进!
百度云下载:http://pan.baidu.com/s/1c6c4eM 密码:t5a4
VC++ 监视文件(夹)的更多相关文章
- 图解SSIS监视文件夹并自动导入数据
原文:图解SSIS监视文件夹并自动导入数据 演示案例:让系统自动监视文件夹,并把文件夹下面的excel文件导入到sql中,之后清空目录.这个过程以往都需要写程序来实现或者定时执行,现在可以用ssis来 ...
- SSIS-WMI监视文件夹
在文档交互数据时,通常会排个job每隔几分钟执行来解析文档,但是jOb不能排的太频繁了,所以文档不能及时的被解析. 在SSIS中可以使用WMI这个组件来监视文件夹,一旦有新文档丢入就马上执行解析程序, ...
- VC.遍历文件夹中的文件
1.VC下遍历文件夹中的所有文件的几种方法 - 年少要轻狂 - CSDN博客.html(https://blog.csdn.net/wllmsdn/article/details/27220999) ...
- VC++ 统计文件夹下面的当日和本月生成的图片
void GetCapNum(int * todayNum, int * mouthNum) { string path = ".\\res";//路径位于程序运行目录下的r ...
- VC++ 遍历文件夹
}; strcpy_s(szFind, MAX_PATH, m_szDir); strcat_s(szFind, "\\*.*"); WIN32_FIND_DATA wfd; HA ...
- apache commons vfs 文件夹监控
package test.vfs; import java.io.File; import org.apache.commons.logging.Log; import org.apache.comm ...
- 文件和文件夹不存在的时候,FileSystemWatcher 监听不到文件的改变?如果递归地监听就可以了
当你需要监视文件或文件夹的改变的时候,使用 FileSystemWatcher 便可以完成.不过,FileSystemWatcher 对文件夹的监视要求文件夹必须存在,否则会产生错误“无效路径”. 那 ...
- windows下使用RoboCopy命令进行文件夹增量备份
RoboCopy,它是一个命令行的目录复制命令,自从Windows NT 4.0 开始就成为windows 资源工具包的一部分,然后在Windows Vista.Windows 7和 Windows ...
- VS15 preview 5打开文件夹自动生成slnx.VC.db SQLite库疑惑?求解答
用VS15 preview 5打开文件夹(详情查看博客http://www.cnblogs.com/zsy/p/5962242.html中配置),文件夹下多一个slnx.VC.db文件,如下图: 本文 ...
随机推荐
- [odroid-pc] ubuntu12.04 64bit Android4.0.3 源码编译报错及解决的方法
第一个错误: host Executable: cmu2nuance (out/host/linux-x86/obj/EXECUTABLES/cmu2nuance_intermedia ...
- 用记事本编写一个Servlet项目
第一步:建立目录 新建一个文件夹FirstServlet,然后在FirstServlet目录下面再建两个文件夹,分别为:WEB-INF和src.最后在WEB-INF下面建一个classes文件夹 第二 ...
- Cookie 获取访问时间
服务器将客户端需要缓存的数据,发送到客户端,客户端保存在本地的这些缓存数据就是Cookie.区别于Session. 获取用户访问时间代码: response.setCharacterEncodin ...
- 执行pig出错Unhandled internal error. Found interface jline.Terminal, but class was expected
执行pig时报例如以下错误 2015-07-14 10:41:12,869 [main] ERROR org.apache.pig.Main - ERROR 2998: Unhandled inter ...
- 【小程序】微信小程序打开其他小程序(打开同一主体公众号下关联的另一个小程序)
微信小程序打开其他小程序(打开同一公众号下关联的另一个小程序) 注:只有同一(主体)公众号下的关联的小程序之间才可相互跳转 wx.navigateToMiniProgram(OBJECT) wx.n ...
- List、Set、Map常见集合遍历总结
Java中的集合有三大类,List.Set.Map,都处于java.util包中,List.Set和Map都是接口,不能被实例化,它们的各自的实现类可以被实例化.List的实现类主要有ArrayLis ...
- JAVA学习第三十二课(经常使用对象API)- 基本数据类型对象包装类
将基本数据类型(8种:int..)封装成对象的优点就是能够在对象中封装很多其它的功能和方法来操控该数据 常见的操作就是:用于基本数据类型与字符串之间的转换 基本数据类型对象包装类一般用于基本类型和字符 ...
- 【web开发学习笔记】Struts-Tags学习笔记1 - 通用标签和控制标签
通用标签和控制标签 第一部分.代码 //前端 <html> <head> <meta http-equiv="Content-Type" conten ...
- 日期常用操作类DateUtil
一.给定yyyy-MM-dd hh:mm:ss格式的字符串,返回Date. public Date convertStr2Date(String dateString) { try { SimpleD ...
- atitit.窗体静听esc退出本窗体java swing c# .net php
atitit.窗体静听esc退出本窗体java swing c# .net php 1. 监听esc 按键 1 1.1. 监听一个组件 1 1.2. 监听加在form上 1 2. 关闭窗体 2 1. ...