C#中的性能问题 [英] performance issue in c#

查看:74
本文介绍了C#中的性能问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在使用c#3.5和SQL Server 2008开发聊天应用程序.我正在使用计时器控件来获取新消息,新用户请求等.计时器间隔为1000毫秒.现在我的问题是Ul不能正确给出响应.


请帮助我,使UI更具响应性.

Hi,


I am developing a chat application using c# 3.5 and SQL Server 2008. I am using a timer control to get new message, new user request etc. the timer interval is 1000ms. Now my problem is that Ul doe not give Response properly.


Please help me to make the UI more responsive.

推荐答案

听起来您正在主线程中运行所有内容.我建议使用System.Threading或BackgroundWorker来运行Timer:

http://msdn.microsoft.com/en-us/library/system.threading.aspx [^ ]

http://msdn.microsoft.com/en-us/library/system.componentmodel. backgroundworker.aspx [ ^ ]
It sounds like you''re running everything in the main thread. I''d recommend using either System.Threading or BackgroundWorker to run the Timer:

http://msdn.microsoft.com/en-us/library/system.threading.aspx[^]

http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx[^]


这篇关于C#中的性能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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