Need to wait until:
- File downloads completely,
- Downloaded file is unlocked.
Till now I am successful in identifying that file is created on specific location. Code is below
FileSystemWatcher FileSystemWatcher = new FileSystemWatcher(downloadpath);
FileSystemWatcher.WaitForChanged(WatcherChangeTypes.Created, 5000);
I want to wait till any attached process detaches its self from the downloaded file so that I can use it again.