简体   繁体   English

Windows Mobile - Compact Framework程序即服务?

[英]Windows Mobile - Compact Framework program as a service?

What is the best way to have my C# Compact Framework program running in the background on a Windows Mobile device ? 在Windows Mobile设备上运行后台运行C#Compact Framework程序的最佳方法是什么? I need to respond to different events, such as a text message arriving with a specific content. 我需要回应不同的事件,例如带有特定内容的短信。 I would like not to start up any UI when the process is started, but just run in the background until UI is needed. 我希望在启动进程时不启动任何UI,而只是在后台运行直到需要UI。

How can this be done ? 如何才能做到这一点 ?

Just create the app as a Console app. 只需将应用程序创建为控制台应用程序。 If you need a message pump, you need to call Run without any parameters, and the CF doesn't have that. 如果您需要消息泵,则需要在没有任何参数的情况下调用Run,而CF则没有。 OpenNETCF's Application2 class in the SDF does. OpenNETCF的SDF中的Application2类确实如此。 At that point you can raise a UI any time by creating and showing a Form as usual. 此时,您可以随时通过创建和显示表单来提升UI。

You cannot create a true service for CE or WinMo with managed code because EE Hosting is not supported. 您无法使用托管代码为CE或WinMo创建真正的服务,因为不支持EE Hosting。

How about this project? 这个项目怎么样?

managedserviceswm.codeplex.com managedserviceswm.codeplex.com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM