Link to home
Start Free TrialLog in
Avatar of rxresults
rxresults

asked on

Identify and move a file using vb.net

I have a client dropping a file once a day into one of my ftp directories I need to capture the file move it to another directory and capture the filename so that I can use it in my console application.  I know exactly which folder it will be dropped in to.  The console app once it is identified opens it and processes it.  Thanks for your help n advance.
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

So you're just looking for the presence of ANY file in a specific directory?...or will it have a specific pattern or extension?
...what if you miss processing one day?  Will there be multiple files or does the file get replaced?
Avatar of rxresults
rxresults

ASKER

Yes  any file in a specific directory. There should be only one file.  The file will be a txt file.  The file is a complete set a data so once I get it I clear my data and repopulate the table with the new file.
Have you looked at file system watcher?

http://www.blackwasp.co.uk/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
Using the code example is there anyway that I can move the file to another folder?
SOLUTION
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
The FileSystemWatcher idea submitted by CodeCruiser is a great approach too.  Sometimes you need both...just depends on exactly what you're doing I suppose.  =)