C#程序非常慢并且挂起mstsc
我正在为某家公司构建 ac# 程序。当我在公司的笔记本电脑上测试该程序时,它运行流畅且稳定。但是当我在微软终端客户端上运行该程序时,在一个具有大约 1000 行和 5 或 6 列的列表视图上运行该程序时,它开始减慢速度,直到没有任何响应并且终端客户端无法使用。表单的代码大约有1000行。
我可以做什么来提高性能?我的代码是否效率低下,或者 mstsc 是否存在一些我必须考虑的限制?
i'm building a c# program for some company. When I test the program from the company's laptop it runs smooth and stable. but when i run the program on a microsoft terminal client, on a from with a listview that can have around 1000 rows and 5 or 6 columns it starts to slow way down until nothing responds and the terminal client is unusable. the code for the form is about 1000 lines.
What can i do to improve performance? is my code that inefficent or are there some limitations on mstsc that i have to take in considiration?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能需要调低 mstsc 体验设置:
运行 MSTSC,然后单击选项>>按钮。
转到体验选项卡。
更改连接速度或自行关闭某些选项(特别是“菜单和窗口动画”)
您可以将这些设置保存为默认设置或为您的特定连接保存 rdp 文件,这样您就不需要每次都调整这些设置时间。
You probably need to tune down the mstsc experience settings:
run MSTSC, then click on the options>> button.
Goto the experience tab.
Either change the connection speed or turn off some of the options yourself (particularly "menu and window animation")
You can save these settings as your default or save an rdp file for your particular connection so that you don't need to tweak these every time.
来自此评论:“我在表单代码中看到了 msrdp 的性能问题,调用了 InvalidateCode,或者 Paint 事件未正确配置的控件。这是您的情况吗?您可以发布一些代码吗? – Steve B “
我发现评论这一小段代码是罪魁祸首,它从来没有打算发布最终版本,而是暂时的,直到设计者的按钮完成为止。为什么我真的不打赌他!现在可以了!
from this comment:" I've seen performances issues with msrdp when in the code of a form, there are calls to InvalidateCode, or controls with Paint event not properly configurated. is it your case ? can you post some code ? – Steve B"
I found that commenting this little piece of code, that was never intended to make the final release, but is temporary until the buttons from the designer are done, was the culprit. why i dont really get bet he! it works now!