Link to home
Start Free TrialLog in
Avatar of bobdylan75
bobdylan75Flag for Afghanistan

asked on

waiting for file creation

Hi,
I've to waiting for a file in a directory.
I explain better:
my program has to waiting that a file will be created in a directory,
so my program have to continue.
How can I do it in Vb.net without Timer object?
and without the code below witch fill all the CPU?
filename=dir(path)
while filename<>""
filename=dir()
end while

Open in new window

Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Your code snippet doesn't tell us which environment you are actually working in...

You using classic VB6 (or below) or VB.Net?  (you have multiple zones selected)
Avatar of bobdylan75

ASKER

VB.NET..
if you read slowly, you note that in the 2nd line from the bottom..
I wrote "how can I do it in Vb.net"
;-)
thanks
Haha...gotcha.  =)

You're looking for the FileSystemWatcher component then:
http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx

ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Wow! Very interesting! thank you very much