在Windows应用程序中冻结 [英] freezing in windows application

查看:244
本文介绍了在Windows应用程序中冻结的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有我制作了一个连接到Web服务的Windows应用程序并获得结果并写入注册表然后下载许多文件



问题是应用程序冻结在这些步骤中,完成这些步骤后它不会冻结工作

...





我怎么样可以解决这个问题??我想禁用此冻结

解决方案

将代码移动到另一个线程:如果您执行的任务需要一些时间(许多Web服务可以)在UI上线程然后在服务代码完成之前无法更新应用程序的图形元素。



看看将代码移动到 BackgroundWorker [ ^ ] - 该链接包含一个示例。


dear all i made a windows application that connects to web service and get result and write to the registry then downloading many files

the problem is that the application freeze during those steps, the after finishing those steps it work without freezing
...


how i can solve this problem?? i want to disable this freezing

解决方案

Move the code into a different thread: if you do a task which takes some time (and many web services can) on the UI thread then the graphics elements of your application cannot be updated until the service code is finished.

Look at moving the code to a BackgroundWorker[^] - the link includes an example.


这篇关于在Windows应用程序中冻结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆