|
-
Aug 9th, 2003, 12:22 AM
#1
Thread Starter
Frenzied Member
How can you detect when a file was created in a folder?
-
Aug 9th, 2003, 12:27 AM
#2
Frenzied Member
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
-
Aug 9th, 2003, 12:44 AM
#3
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.
-
Aug 9th, 2003, 01:23 AM
#4
Thread Starter
Frenzied Member
tried it, but it seems to log "I:\" fine, but does nothing with I:\Documents and Settings\VaxoP\Local Settings\Temporary Internet Files
-
Aug 9th, 2003, 01:25 AM
#5
Thread Starter
Frenzied Member
is it possible to monitor subdirectories as well?
-
Aug 9th, 2003, 03:40 AM
#6
here's a quick example to get you started.
VB Code:
[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")
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]
-
Aug 9th, 2003, 08:47 AM
#7
Frenzied Member
Originally posted by VaxoP
is it possible to monitor subdirectories as well?
Yes.
-
Aug 9th, 2003, 05:40 PM
#8
Thread Starter
Frenzied Member
how can you monitor subdirectories as well?
-
Aug 9th, 2003, 06:16 PM
#9
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|