I need to execute a Process where a file is downloaded using ftp and then parsed and the results used to update some tables in a database.
The system is built using a WPF client using WCF services to talk with the database.
I need to start the process开发者_如何学Python from the WPF application. Now my question is:
Should I download the file on the client and then use the wpf to parse the data and to do the update using the services?
or should I download the file to the server where the services are hosted and proceed to update the database there? And if so how do I provide feedback to the client that the process is running/finished,etc?
I preffer the second alternative, but I am not sure on how to implement the feedback on the background process...
Thanks
There could be number of solutions to your problem but I can think of two at the moment.
You could maintain a flag in the database table. Which a background thread in a WPF apllication will poll at set intervals and read the flag to update the status.
You can make use of a FileSystemWatcher. If you are on the Intranet and you can write into the file that you are processing. A FileSystemWatcher can raise events in the WPF application.
精彩评论