filesystemwatcher file access

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lars Nielsen

    #1

    filesystemwatcher file access

    Hi
    Is it possible to add more events to the FileSystemWatch er object than the
    standard create, change, delete and rename? I want to use it to watch if
    anyone opens or accesses a file?

    regards
    Lars Nielsen


  • Sherif ElMetainy

    #2
    Re: filesystemwatch er file access

    Hello

    Add NotifyFilters.L astAccess flag to NotifyFilter property for
    FileSystemWatch er. I think this is what you want.

    Best regards
    Sherif

    "Lars Nielsen" <ln_remove_@vid enfabrikken.dk> wrote in message
    news:bqn2mb$2is $1@news.cyberci ty.dk...[color=blue]
    > Hi
    > Is it possible to add more events to the FileSystemWatch er object than the
    > standard create, change, delete and rename? I want to use it to watch if
    > anyone opens or accesses a file?
    >
    > regards
    > Lars Nielsen
    >
    >[/color]


    Comment

    • Ignacio Machin \( .NET/ C#  MVP \)

      #3
      Re: filesystemwatch er file access

      Hi Lars,

      IIRC if you open a file the last access time will change, if so you can use
      the Changed event of the FileSystemWatch er to detect it, if so you can use
      FileSystemEvent Args.ChangeType track it, What I don't know for sure is if
      you can filter an open operation from the rest of the changes detected.


      Cheers,

      --
      Ignacio Machin,
      ignacio.machin AT dot.state.fl.us
      Florida Department Of Transportation



      "Lars Nielsen" <ln_remove_@vid enfabrikken.dk> wrote in message
      news:bqn2mb$2is $1@news.cyberci ty.dk...[color=blue]
      > Hi
      > Is it possible to add more events to the FileSystemWatch er object than the
      > standard create, change, delete and rename? I want to use it to watch if
      > anyone opens or accesses a file?
      >
      > regards
      > Lars Nielsen
      >
      >[/color]


      Comment

      Working...