CnPack Forum


 
Subject: 关于FileSystemWatcher监视其他电脑文件变动的问题
010224
新警察
Rank: 1



UID 24582
Digest Posts 0
Credits 24
Posts 7
点点分 24
Reading Access 10
Registered 2007-8-31
Status Offline
Post at 2010-1-30 21:43  Profile | Blog | P.M. 
关于FileSystemWatcher监视其他电脑文件变动的问题

不知道FileSystemWatcher能否检测到其他电脑上文件或文件夹的变化?
我想做一个程序,定时去检测局域网中另外一台电脑上文件的变化情况,但是不知道为什么检测不到。
该电脑上的文件夹已开放共享的读写权限。
代码取自FileSystemWatcher

procedure TForm1.btnRemoteClick(Sender: TObject);

var

  tmpnf: TNotifyFilters;

begin

  FileSystemWatcher1.WatchedDir := '\\192.168.1.11\FileSystemWatcher\';



  tmpnf := [];

  if CheckBox3.Checked then

    Include(tmpnf, nfFileNameChange);

  if CheckBox4.Checked then

    Include(tmpnf, nfDirNameChange);

  if CheckBox5.Checked then

    Include(tmpnf, nfAttributeChange);

  if CheckBox6.Checked then

    Include(tmpnf, nfSizeChange);

  if CheckBox7.Checked then

    Include(tmpnf, nfWriteChange);

  if CheckBox8.Checked then

    Include(tmpnf, nfAccessChange);

  if CheckBox9.Checked then

    Include(tmpnf, nfCreationDateChange);

  if CheckBox10.Checked then

    Include(tmpnf, nfSecurityChange);



  FileSystemWatcher1.NotifyFilters := tmpnf;



  FileSystemWatcher1.IncludePath := True;

  FileSystemWatcher1.Active := True;  

end;

[ 本帖最后由 010224 于 2010-1-30 21:45 编辑 ]
Top
小帆
普通灌水员
Rank: 2



UID 1619
Digest Posts 0
Credits 63
Posts 24
点点分 63
Reading Access 10
Registered 2006-1-4
Status Offline
Post at 2010-3-4 19:04  Profile | Blog | P.M. 
可以监视,我就是用此单元写了个厂里的互相传递文件监视的小软件。
Top
 




All times are GMT++8, the time now is 2024-4-18 22:40

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.007379 second(s), 7 queries , Gzip enabled

Clear Cookies - Contact Us - CnPack Website - Archiver - WAP