每1分钟重复调用一次方法 [英] Calling a method repeatedly for every 1 min

查看:61
本文介绍了每1分钟重复调用一次方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想每隔1分钟调用一个方法,任何人都可以提供示例代码。我尝试使用线程,但它没有帮助我

解决方案

检查此链接,解释如何安排Windows服务和计时器来完成您的要求。



http://www.aspfree.com/c/a/C-Sharp/Timer-Objects-in-Windows-Services-with-C-NET/ [ ^ ]



希望这有帮助


您可以使用System.Timer参见此处 [ ^ ],例如代码。


你可以轻松地使用Windows服务和webservice

点击这里结合Web和Windows服务以预定的时间间隔运行ASP.NET代码 [ ^ ]

I want to call a method for every 1min can anyone please give a sample code. I tried doing using thread but its not helping me

解决方案

check this link which explains how to schedule a windows service and timer to accomplish your requirement .

http://www.aspfree.com/c/a/C-Sharp/Timer-Objects-in-Windows-Services-with-C-NET/[^]

Hope this helps


You can use a System.Timer see here[^] for example code.


You can do it with windows service and webservice easily
Check here Combine Web and Windows Services to Run Your ASP.NET Code at Scheduled Intervals[^]


这篇关于每1分钟重复调用一次方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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