简体   繁体   中英

Calling a function automatically in C#.Net

I would like to call a function automatically lets say every 2 secs.

Is this possible with .NET, and if so can you please paste some code? This will be used in Windows Mobile 6 SDK

thanks

Have a look at the Timer Class :

Provides a mechanism for executing a method at specified intervals.

Platforms: [...], .NET Compact Framework

You can find an example in the linked MSDN documentation.

计时器类是您需要使用的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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