开发者

Background Process in WPF WCF Application

开发者 https://www.devze.com 2023-02-01 13:40 出处:网络
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.

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.

  1. 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.

  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消