일부 파일을 관리하는 간단한 프로그램을 만들고 해당 프로그램이 사용자가 수행 한 파일 이동을 추적해야합니다.Windows 탐색기 이벤트 모니터링
(I 실행중인 모든 Windos 탐색기의 창을 잡기에 대해 항상 트레이 표시 줄에 활성화 된 프로그램을 유지하는 약이 시점에서 걱정 안 해요,하지만 나중에 다른 질문에 요청할 수 있습니다) 그래서
, 내가 필요가 단순히 :
- 의 윈도우 탐색기를 실행
- 모니터 모든 파일 (즉, 창 내부 사용자에 의한) 운동, 창조 및 제외
C#과 함께 사용할 API가 있습니까?
P.S : Winforms 응용 프로그램이므로 다른 방법으로도이 기능을 사용할 수 있습니다.
감사합니다.
FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(@"E:\TestDir");
fileSystemWatcher.Changed += OnChanged;
fileSystemWatcher.Created += OnChanged;
fileSystemWatcher.Deleted += OnChanged;
fileSystemWatcher.Renamed += OnChanged;
fileSystemWatcher.EnableRaisingEvents = true;
그리고는 onChanged 이벤트 :
실제로 Windows 탐색기의 좀비 사본을 사용해야합니까? 또는 파일 추적이 주요 작업입니까? –
[this] (http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher%28v=vs.110%29.aspx)와 같은 것입니까? – Nasreddine
파일 추적이 주요 작업입니다. 방금 Windows 탐색기에서 더 나은 옵션이있는 것처럼 보였습니다 ... –