在待机状态下运行程序 [英] Running a program while In Stand by

查看:95
本文介绍了在待机状态下运行程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我最近在Microsoft 2003服务器上创建了一个监视网站的解决方案.当服务器不处于待机状态时,该程序可以正常运行.当服务器注销时,所有程序都将关闭.这是我的麻烦开始的地方.该程序需要运行24/7不间断才能生效.

即使用户注销或计算机处于待机模式,我如何仍可以使程序保持运行状态?我是否需要告诉OS使其保持运行状态,或者可以对其中进行编程以使其在待机模式下运行?如果是,该怎么办?



ERic

解决方案

听起来像您想让程序作为Windows服务运行(因此它不与任何特定的登录会话相关).检查MSDN文档或搜索网络以在.NET中编写Windows服务(如果内存为我服务,则某些相关的类可能是ServiceController,ServiceProcessInstaller).此外,当计算机真正处于待机模式时,没有任何程序真正在运行,但是您可以要求Windows在特定时间退出待机状态以运行程序.

Rick

Hi,
I have recently created a solution which monitors a website, on a Microsoft 2003 server. The program runs fine while the server is not in stand by. When the server logs off, all programs are closed. This is where my trouble starts. This program needs to run 24/7 non stop in order to be effective.

How Can i get my program to stay running even while users are logged off, and or the computer is in stand by mode? Do I need to tell the OS to leave it running or Can I program some thing into it to keep it running in standby mode. If so, what?



ERic

解决方案

Sounds like you want to make your program run as a windows service (so it's not tied to any particular log-in session).  Check the MSDN documentation or search the web for writing windows services in .NET (if memory serves me, some of the relevant classes may be ServiceController, ServiceProcessInstaller).  Also, no program is really running when a computer is truly in standby mode, but you may be able to ask Windows to come out of standby at a particular time in order to run your program.

Rick


这篇关于在待机状态下运行程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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