开发者

Cancelling call to web-service from application

I have a winform app that has two buttons GetData and Close. On GetData I retrieve some data from a web-service whereas Close just closes the dialog. I am calling the web-service on a separate thread. This thread is class instance variable. If getting data from web-service is taking开发者_开发技巧 too long and user click on close, I want to cancel that call to web-service and just close the dialog.

What is the best way of cancelling that call to web-service, by just calling abort on thread instance? Any other idea/best practices are welcome too.


You can not cancel it. Once the webservice call is placed then it will get executed even if the calling thread is aborted.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜