如何制作将一直运行的实体Windows应用程序? [英] How to make solid windows application that will be running all time?

查看:85
本文介绍了如何制作将一直运行的实体Windows应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让windows应用程序充当代理以检索资源管理信息。它将尽快全天运行。


如何使其稳定?


它非常考虑性能问题,如垃圾收集,Memony管理。


此外,我想知道使应用程序不间断运行的逻辑,例如循环停止,事件处理程序等等。


 


请帮助我。


感谢您的帮助。


^^

解决方案


 


通常,长时间运行的应用程序将创建为Windows服务。这些服务由Windows维护,以便更好地管理内存,生命周期等...


因为您需要循环遍历所有时间,您可以在一个线程中执行此操作并且应该使用一些理想的睡眠时间,如Thread.Sleep(1000);这将暂停1000秒。


如果您还需要一个用户界面,那么将您的应用程序拆分为两个项目。一个用作服务,用于执行长时间运行的任务,另一个用于UI。


使用WCF作为从UI(Windows应用程序)到服务应用程序的通信框架。


 


I want to make windows application that act as an agent for retriving resource management information. It will be running all day as soon as all night as possible.

How to make it solid?

It very consider about performance issue such as Garbage Collection, Memony Management.

In addition, I want to know what logical that make an application running non stop such as looping it non stop, event handler and so on.

 

Please help me.

Thank You for all help.

^^

解决方案

Hi,

 

Generally long running applications will be created as Windows Services. These services are maintained by Windows for better management of Memory, Life Time etc...

Since you need to loop through all time you can just do that in a thread and should be using some ideal sleep time in between like Thread.Sleep(1000); which will pause 1000 seconds.

If you need a UI also then split your application two 2 projects. One as Service which take long running tasks and one for UI.

Use WCF as communication framework from UI (Windows App) to Service App.

 


这篇关于如何制作将一直运行的实体Windows应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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