Results 1 to 9 of 9

Thread: How can you detect when a file was created in a folder?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2003
    Posts
    1,269

    How can you detect when a file was created in a folder?

    anyone know?

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    From your posts it seems that you are learning VB. NET from this forum
    There is a FileInfo and File class in System.IO namespace that you can look at them for what you need.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403
    If you want to be notified when a file is created, take a look at the System.IO.FileSystemWatcher class; otherwise the previous reply is your answer
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2003
    Posts
    1,269
    tried it, but it seems to log "I:\" fine, but does nothing with I:\Documents and Settings\VaxoP\Local Settings\Temporary Internet Files

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2003
    Posts
    1,269
    is it possible to monitor subdirectories as well?

  6. #6
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    here's a quick example to get you started.
    VB Code:
    1. [COLOR=BLUE]Dim[/COLOR] fileTime [COLOR=BLUE]As[/COLOR] [COLOR=BLUE]String[/COLOR] = IO.File.GetCreationTime("C:\WINDOWS\Temp\Temporary Internet Files\Content.IE5\index.dat")
    2.  
    3. MessageBox.Show(fileTime)
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

  7. #7
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Originally posted by VaxoP
    is it possible to monitor subdirectories as well?
    Yes.

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2003
    Posts
    1,269
    how can you monitor subdirectories as well?

  9. #9
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    The FileSystemWatcher object has a IncludeSubdirectories property. Set it to true.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width