[英]How to Auto Call My Method In Time Period Without Running any WebPage in my application in ASP.net C#?
I Want to Automatically Run my Method in evry for example 10 minute. 我想自动运行我的方法,例如10分钟。 But i Do not want to Run Any Page to Do it. 但是我不想运行任何页面来做到这一点。 I Want to Click on a button and then EVEN IF I CLOSE MY PAGE the application Do the method evry 10 minute. 我要单击一个按钮,然后即使我关闭了我的页面,也要单击该应用程序。请在方法上运行10分钟。 For Example : 例如 :
protected void AutoButton_Click(object sender, EventArgs e)
{//I want to application run above methods evry 10 minute EVEN IF I CLOSE THE PAGE
GetGoldPrices();
SaveGoldPrices();
GetCoinPrices();
SaveCoinPrices();
GetExchangePrices();
SaveExchangePrices();
}
I Found This Article which was useful but i get my host from a company and can not set any thing out of my WEB SITE PANEL... Any suggest to how can i do this please? 我发现这篇文章很有用,但是我从一家公司得到了我的托管,无法在我的网站面板上进行任何设置...对我该如何做有任何建议吗?
Take a look at http://www.codeproject.com/Articles/6507/NET-Scheduled-Timer 看看http://www.codeproject.com/Articles/6507/NET-Scheduled-Timer
Its a nice package for scheduling repeating functions. 它是安排重复功能的好工具。
You would have to set up a timer at the top level of your program if you want it to run even when the pages are closed. 如果您希望即使在关闭页面后也要运行该程序,则必须在程序的顶层设置一个计时器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.