且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

定时器服务问题

更新时间:2023-11-27 21:56:34




" Kevin Antel <柯**** @ cqlcorp.com>写在留言中

新闻:uv ************** @ TK2MSFTNGP09.phx.gbl ...
Hi,

"Kevin Antel" <ke****@cqlcorp.com> wrote in message
news:uv**************@TK2MSFTNGP09.phx.gbl...
我们写了一个服务每隔60秒使用一次计时器控制来检查一个过程。它安装在带有SP1的Windows 2003 Server上。

我们遇到的问题是服务没有停止,但它似乎停止了计时器进程。有没有其他人遇到这个?什么有解决方案?
We have written a service that uses a timer control to check for a process
every 60 seconds. This is installed on a Windows 2003 Server w/SP1.

The problem we are running into is that the service doesn''t stop, but it
seems the timer process stops. Has anyone else run into this? What have
been solutions?




你使用什么Timer类?您应该使用System.Timers.Timer和

确保AutoReset设置为true


-

Ignacio Machin,

ignacio.machin AT dot.state.fl.us

佛罗里达州交通局



What Timer class r u using? You should be using System.Timers.Timer and
make sure that the AutoReset is set to true

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


我们是使用System.Timers.Timer,我们将AutoReset设置为True。

m_Timer.AutoReset = true;


" Ignacio Machin(.NET / C# MVP) < ignacio.machin AT dot.state.fl.us>在消息新闻中写了

:%2 **************** @ TK2MSFTNGP14.phx.gbl ...
We are using System.Timers.Timer and we do have AutoReset set to True.
m_Timer.AutoReset = true;

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:%2****************@TK2MSFTNGP14.phx.gbl...


凯文安特尔 &LT;柯**** @ cqlcorp.com&GT;在消息中写道
新闻:uv ************** @ TK2MSFTNGP09.phx.gbl ...
Hi,

"Kevin Antel" <ke****@cqlcorp.com> wrote in message
news:uv**************@TK2MSFTNGP09.phx.gbl...
我们编写了一个使用计时器的服务控制每隔60秒检查一次
进程。这是安装在Windows 2003 Server
w / SP1上。

我们遇到的问题是服务没有停止,但它似乎是计时器进程停止。有没有其他人遇到这个?什么有解决方案?
We have written a service that uses a timer control to check for a
process every 60 seconds. This is installed on a Windows 2003 Server
w/SP1.

The problem we are running into is that the service doesn''t stop, but it
seems the timer process stops. Has anyone else run into this? What have
been solutions?



Timer类使用什么?你应该使用System.Timers.Timer和
确保AutoReset设置为true

- Ignacio Machin,
ignacio.machin AT dot。 state.fl.us
佛罗里达州交通局



What Timer class r u using? You should be using System.Timers.Timer and
make sure that the AutoReset is set to true

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation






凯文安特尔 &LT;柯**** @ cqlcorp.com&GT;在消息中写道

新闻:eY ************** @ TK2MSFTNGP11.phx.gbl ...
Hi,

"Kevin Antel" <ke****@cqlcorp.com> wrote in message
news:eY**************@TK2MSFTNGP11.phx.gbl...
我们正在使用System。 Timers.Timer,我们确实将AutoReset设置为True。
m_Timer.AutoReset = true;
We are using System.Timers.Timer and we do have AutoReset set to True.
m_Timer.AutoReset = true;




服务是做什么的?

它是在第一次或几次事件之后发生的吗?

您是否正在处理所有例外情况?使用AppDomain.UnHandledException


我有一个类似的环境,我还没有遇到任何问题,计时器

(和一个filesystemwatcher)按预期工作所有的时间。



-

Ignacio Machin,

ignacio.machin at dot.state.fl .us

佛罗里达州交通局



What the service does?
Does it happen the first time or after several events?
Are you handling all the exceptions ? using AppDomain.UnHandledException

I have a similar environment and I haven''t had any problem yet, the timer
(and a filesystemwatcher) works as expected all the time.


--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation