newsgroups-index (beta)

Current group: microsoft.public.cn.dotnet.languages.csharp

System.Threading.Timer,System.Timers和System.Windows.Forms.Timer三者到底有什么区别?

System.Threading.Timer,System.Timers和System.Windows.Forms.Timer三者到底有什么区别?  
nicholas
 =?gb2312?B?UmU6IFN5c3RlbS5UaHJlYWRpbmcuVGltZXKjrFN5c3RlbS5UaW1lcg==?=  
Vince Yuan
 =?gb2312?B?UmU6IFN5c3RlbS5UaHJlYWRpbmcuVGltZXKjrFN5c3RlbS5UaW1lcg==?=  
nicholas
From:nicholas
Subject:System.Threading.Timer,System.Timers和System.Windows.Forms.Timer三者到底有什么区别?
Date:Tue, 18 Jan 2005 10:33:08 +0800
看了MSDN上的讲解后有了一些了解,但是到实际工作中还是不太明白什么时候该用哪
个。希望有人能给我解一下这个惑,不胜感激
From:Vince Yuan
Subject:=?gb2312?B?UmU6IFN5c3RlbS5UaHJlYWRpbmcuVGltZXKjrFN5c3RlbS5UaW1lcg==?=
Date:Tue, 18 Jan 2005 12:13:34 +0800
This is a multi-part message in MIME format.

------=_NextPart_000_0021_01C4FD57.21C7F0B0
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable

=CE=D2=B3=F5=B2=BD=BF=B4=C1=CB=D2=BB=CF=C2=A3=AC=BF=B4=B5=BD=C1=CB=D2=BB=D0=
=A9=B2=BB=CD=AC=B5=E3=A3=BA
Threading.Timer: The timer delegate is specified when the timer is =
constructed, and cannot be changed. The method does not execute in the =
thread that created the timer; it executes in a thread pool thread =
supplied by the system.
Timers.Timer is a server-based timer. The server-based Timer is designed =
for use with worker threads in a multithreaded environment.=20
Forms.Timer is designed for a single-threaded environment where UI =
threads are used to perform processing.=20

--=20
Vince


"nicholas" wrote in message =
news:uIJdAYQ$EHA.824@TK2MSFTNGP11.phx.gbl...
> =
=BF=B4=C1=CBMSDN=C9=CF=B5=C4=BD=B2=BD=E2=BA=F3=D3=D0=C1=CB=D2=BB=D0=A9=C1=
=CB=BD=E2=A3=AC=B5=AB=CA=C7=B5=BD=CA=B5=BC=CA=B9=A4=D7=F7=D6=D0=BB=B9=CA=C7=
=B2=BB=CC=AB=C3=F7=B0=D7=CA=B2=C3=B4=CA=B1=BA=F2=B8=C3=D3=C3=C4=C4
> =
=B8=F6=A1=A3=CF=A3=CD=FB=D3=D0=C8=CB=C4=DC=B8=F8=CE=D2=BD=E2=D2=BB=CF=C2=D5=
=E2=B8=F6=BB=F3=A3=AC=B2=BB=CA=A4=B8=D0=BC=A4
>=20
>
------=_NextPart_000_0021_01C4FD57.21C7F0B0
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable








size=3D2>=CE=D2=B3=F5=B2=BD=BF=B4=C1=CB=D2=BB=CF=C2=A3=AC=BF=B4=B5=BD=C1=CB=
=D2=BB=D0=A9=B2=BB=CD=AC=B5=E3=A3=BA

Threading.Timer: The timer delegate is =
specified=20
when the timer is constructed, and cannot be =
changed
.=20
The method does not execute in the thread that created the timer; color=3D#ff0000>it executes in a thread pool thread supplied by the=20
system
.

Timers.Timer is a server-based timer. =
The=20
server-based Timer is designed for use with worker threads in a color=3D#ff0000>multithreaded
environment.

Forms.Timer is designed for a =
color=3D#ff0000>single-threaded
environment where UI threads are =
used to=20
perform processing.


--
Vince

 

 

"nicholas" <href=3D"mailto:nicholas_by@sina.com.cn">size=3D2>nicholas_by@sina.com.cnsize=3D2>> wrote in=20
message
href=3D"news:uIJdAYQ$EHA.824@TK2MSFTNGP11.phx.gbl">face=3DArial =
size=3D2>news:uIJdAYQ$EHA.824@TK2MSFTNGP11.phx.gbl
face=3DArial size=3D2>...
>=20
=BF=B4=C1=CBMSDN=C9=CF=B5=C4=BD=B2=BD=E2=BA=F3=D3=D0=C1=CB=D2=BB=D0=A9=C1=
=CB=BD=E2=A3=AC=B5=AB=CA=C7=B5=BD=CA=B5=BC=CA=B9=A4=D7=F7=D6=D0=BB=B9=CA=C7=
=B2=BB=CC=AB=C3=F7=B0=D7=CA=B2=C3=B4=CA=B1=BA=F2=B8=C3=D3=C3=C4=C4
>=
; =
=B8=F6=A1=A3=CF=A3=CD=FB=D3=D0=C8=CB=C4=DC=B8=F8=CE=D2=BD=E2=D2=BB=CF=C2=D5=
=E2=B8=F6=BB=F3=A3=AC=B2=BB=CA=A4=B8=D0=BC=A4
>=20

>


------=_NextPart_000_0021_01C4FD57.21C7F0B0--
From:nicholas
Subject:=?gb2312?B?UmU6IFN5c3RlbS5UaHJlYWRpbmcuVGltZXKjrFN5c3RlbS5UaW1lcg==?=
Date:Tue, 18 Jan 2005 13:19:03 +0800
This is a multi-part message in MIME format.

------=_NextPart_000_000D_01C4FD60.47E9AA00
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable

=B5=DA=C8=FD=B8=F6=B5=C4=B5=A5=CF=DF=B3=CC=CA=C7=CA=B2=C3=B4=D2=E2=CB=BC=A3=
=BF
=BC=C8=C8=BB=CA=C7=BC=C6=CA=B1=C6=F7=A3=AC=BF=CF=B6=A8=CA=C7=D4=DA=D2=BB=B8=
=F6=B5=A5=B6=C0=B5=C4=CF=DF=B3=CC=D6=D0=BC=C6=CA=B1=B5=C4=A3=AC=C4=C7=CB=F9=
=CB=B5=B5=C4=B5=A5=CF=DF=B3=CC=D3=D6=CA=C7=CA=B2=C3=B4=D2=E2=CB=BC=C4=D8=A3=
=BF
"Vince Yuan" =D0=B4=C8=EB=D3=CA=BC=FE =
news:OcjhVQR$EHA.1392@tk2msftngp13.phx.gbl...
=
=CE=D2=B3=F5=B2=BD=BF=B4=C1=CB=D2=BB=CF=C2=A3=AC=BF=B4=B5=BD=C1=CB=D2=BB=D0=
=A9=B2=BB=CD=AC=B5=E3=A3=BA
Threading.Timer: The timer delegate is specified when the timer is =
constructed, and cannot be changed. The method does not execute in the =
thread that created the timer; it executes in a thread pool thread =
supplied by the system.
Timers.Timer is a server-based timer. The server-based Timer is =
designed for use with worker threads in a multithreaded environment.=20
Forms.Timer is designed for a single-threaded environment where UI =
threads are used to perform processing.=20

--=20
Vince


"nicholas" wrote in message =
news:uIJdAYQ$EHA.824@TK2MSFTNGP11.phx.gbl...
> =
=BF=B4=C1=CBMSDN=C9=CF=B5=C4=BD=B2=BD=E2=BA=F3=D3=D0=C1=CB=D2=BB=D0=A9=C1=
=CB=BD=E2=A3=AC=B5=AB=CA=C7=B5=BD=CA=B5=BC=CA=B9=A4=D7=F7=D6=D0=BB=B9=CA=C7=
=B2=BB=CC=AB=C3=F7=B0=D7=CA=B2=C3=B4=CA=B1=BA=F2=B8=C3=D3=C3=C4=C4
> =
=B8=F6=A1=A3=CF=A3=CD=FB=D3=D0=C8=CB=C4=DC=B8=F8=CE=D2=BD=E2=D2=BB=CF=C2=D5=
=E2=B8=F6=BB=F3=A3=AC=B2=BB=CA=A4=B8=D0=BC=A4
>=20
>
------=_NextPart_000_000D_01C4FD60.47E9AA00
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable








size=3D2>=B5=DA=C8=FD=B8=F6=B5=C4=B5=A5=CF=DF=B3=CC=CA=C7=CA=B2=C3=B4=D2=E2=
=CB=BC=A3=BF

size=3D2>=BC=C8=C8=BB=CA=C7=BC=C6=CA=B1=C6=F7=A3=AC=BF=CF=B6=A8=CA=C7=D4=DA=
=D2=BB=B8=F6=B5=A5=B6=C0=B5=C4=CF=DF=B3=CC=D6=D0=BC=C6=CA=B1=B5=C4=A3=AC=C4=
=C7=CB=F9=CB=B5=B5=C4=B5=A5=CF=DF=B3=CC=D3=D6=CA=C7=CA=B2=C3=B4=D2=E2=CB=BC=
=C4=D8=A3=BF

style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Vince Yuan" < href=3D"mailto:shinebean@citiz.net">shinebean@citiz.net> =
=D0=B4=C8=EB=D3=CA=BC=FE =
href=3D"news:OcjhVQR$EHA.1392@tk2msftngp13.phx.gbl">news:OcjhVQR$EHA.1392=
@tk2msftngp13.phx.gbl...

size=3D2>=CE=D2=B3=F5=B2=BD=BF=B4=C1=CB=D2=BB=CF=C2=A3=AC=BF=B4=B5=BD=C1=CB=
=D2=BB=D0=A9=B2=BB=CD=AC=B5=E3=A3=BA

Threading.Timer: The timer delegate =
is specified=20
when the timer is constructed, and cannot be=20
changed
. The method does not execute in the thread that created =
the=20
timer; it executes in a thread pool thread =
supplied by the=20
system
.

Timers.Timer is a server-based timer. =
The=20
server-based Timer is designed for use with worker threads in a color=3D#ff0000>multithreaded
environment.

Forms.Timer is designed for a =
color=3D#ff0000>single-threaded
environment where UI threads =
are used to=20
perform processing.


--
Vince

 

 

"nicholas" < href=3D"mailto:nicholas_by@sina.com.cn"> size=3D2>nicholas_by@sina.com.cnsize=3D2>> wrote in=20
message
href=3D"news:uIJdAYQ$EHA.824@TK2MSFTNGP11.phx.gbl"> face=3DArial =
size=3D2>news:uIJdAYQ$EHA.824@TK2MSFTNGP11.phx.gbl
face=3DArial size=3D2>...
> =

=
=BF=B4=C1=CBMSDN=C9=CF=B5=C4=BD=B2=BD=E2=BA=F3=D3=D0=C1=CB=D2=BB=D0=A9=C1=
=CB=BD=E2=A3=AC=B5=AB=CA=C7=B5=BD=CA=B5=BC=CA=B9=A4=D7=F7=D6=D0=BB=B9=CA=C7=
=B2=BB=CC=AB=C3=F7=B0=D7=CA=B2=C3=B4=CA=B1=BA=F2=B8=C3=D3=C3=C4=C4
>=
; =
=B8=F6=A1=A3=CF=A3=CD=FB=D3=D0=C8=CB=C4=DC=B8=F8=CE=D2=BD=E2=D2=BB=CF=C2=D5=
=E2=B8=F6=BB=F3=A3=AC=B2=BB=CA=A4=B8=D0=BC=A4
>=20

>


------=_NextPart_000_000D_01C4FD60.47E9AA00--
   

Copyright © 2006 newsgroups-index   -   All rights reserved   -   Impressum