CnPack Forum » CnVCL 组件包 » 关于FileSystemWatcher监视其他电脑文件变动的问题


2010-1-30 21:43 010224
关于FileSystemWatcher监视其他电脑文件变动的问题

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

[[i] 本帖最后由 010224 于 2010-1-30 21:45 编辑 [/i]]

2010-3-4 19:04 小帆
可以监视,我就是用此单元写了个厂里的互相传递文件监视的小软件。

页: [1]


Powered by Discuz! Archiver 5.0.0  © 2001-2006 Comsenz Inc.