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文件,如下图: 本文 ...
随机推荐
- Android 应用开发实例之文件管理器
2013-07-02 10.2 文件管理器 能够浏览和管理手机/存储卡上的文件和文件夹,包括重命名.删除.新建.复制.粘帖等文件操作. 由于需要浏览大量的文件/文件夹,所以需要使用一个ListView ...
- EL表达式中fn函数
JSTL 使用表达式来简化页面的代码,这对一些标准的方法,例如bean的getter/setter方法,请求参数或者context以及 session中的数据的访问非常方便,但是我们在实际应用中经常需 ...
- storm trident merger
import java.util.List; import backtype.storm.Config; import backtype.storm.LocalCluster; import back ...
- Content Editor Webpart(一)引用JQuery
SharePoint里面自带了一个Content Editor Webpart, 使用这个webpart.能够方便的往页面上加入随意的内容(HTML,css, JS).以此来达到往页面加入自己定义内容 ...
- express 设置header解决跨域问题
//设置跨域访问 app.all('*', function(req, res, next) { res.header("Access-Control-Allow-Origin", ...
- spring in action 8.1 使用Spring web flow
一.说明 Spring Web Flow是spring MVC的扩展,它支持基于流程的应用程序,他将流程的定义和实现流程行为的类和视图分离开来. 1.1 spring中配置web flow,目前需要在 ...
- 最简单的TCP网络封包解包(补充)-序列化
如若描述或者代码当中有谬误之处,还望指正. 将数据能够在TCP中进行传输的两种方法1.直接拷贝struct就可以了:2.序列化. 拷贝Struct存在的问题1.不能应付可变长类型的数据,比如STL中的 ...
- 点滴积累【other】---HTTP 错误 404.13 - Not Found,请求筛选模块被配置为拒绝超过请求内容长度的请求(转载)
此文参考来源:http://blog.csdn.net/tiantian1980/article/details/6577499 问题:HTTP 错误 404.13 - Not Found,请求筛选模 ...
- Centos7 安装Git-cola
首先安装Git sudo yum -y install git* 找到 git-all.noarch , 安装这个. sudo yum install git-all.noarch ========= ...
- filter函数和map函数
filter filter()函数接收一个函数 f 和一个可迭代对象,这个函数 f 的作用是对每个元素进行判断,返回 True或 False,filter()根据判断结果自动过滤掉不符合条件的元素,返 ...