开发者

Calling a function automatically in C#.Net

开发者 https://www.devze.com 2023-01-01 21:35 出处:网络
I would like to call a function automatically lets say every 2 secs. Is this possible with 开发者_StackOverflow社区.NET, and if so can you please paste some code?

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

Is this possible with 开发者_StackOverflow社区.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.


Use the System.Threading.Timer:

http://msdn.microsoft.com/library/system.threading.timer.aspx


The Timer Class is what you need to use.

0

精彩评论

暂无评论...
验证码 换一张
取 消