1
Answer

File.Move() Issue with FileSystemWatcher

Photo of Administrator

Administrator

22y
5.5k
1
I am using the FileSystemWatcher method to watch a folder. When a file arrives it will move the file to a process folder. My problem is when a large file is put in the folder the move command errors with Unhandled Exception: System.IO.IOException: The process cannot access the file "c:\temp\test.zip" because it is being used by another process. Obviously the file has not finished copying to the directory. Is there an attribute on the file that I can check to see if it can be moved or is there a filter that I can use that will only trip the oncreated event after the file has completely copied to the folder.

Answers (1)

0
Photo of Mykonine
NA 520 0 20y
I should probably make myself clearer: When you put your mouse over the icon a certain text is displayed. I want to programmatically force that same box with text to display without requiring the user to hover the mouse over the icon. Basically an alert.