不知道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 编辑 ]