Click here to Skip to main content
16,021,464 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When file is modified or added in a particular directory.
I need to Upload those files to FTP server.
And before Uploading those files i need to show notify icon on the bottom task bar.
Thanking you in Advance.
Posted

1 solution

Assuming your're using winforms or wpf you can use FileSystemWatcher

C#
FileSystemWatcher fsw = new FileSystemWatcher("mydir");
fsw.Changed += new FileSystemEventHandler(fsw_Changed);
fsw.NotifyFilter = NotifyFilters.LastWrite;
fsw.EnableRaisingEvents = true;


The fsw will raise the event if the file is modified.
On the change-event, you can run your upload code and the notification in the tray or taskbar.

maybe you also want to use a filefilter like this
C#
FileSystemWatcher fsw = new FileSystemWatcher("mydir", ".dat");
 
Share this answer
 
Comments
Avinash502 16-Jul-13 4:36am    
Is it Possible to Show Progress bar in the bottom task bar until the files are uploaded to FTP Server??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900