[英]C#, ASP.NET how to call method during each call of any method of my Controller
[英]How to Auto Call My Method In Time Period Without Running any WebPage in my application in ASP.net C#?
我想自動運行我的方法,例如10分鍾。 但是我不想運行任何頁面來做到這一點。 我要單擊一個按鈕,然后即使我關閉了我的頁面,也要單擊該應用程序。請在方法上運行10分鍾。 例如 :
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();
}
我發現這篇文章很有用,但是我從一家公司得到了我的托管,無法在我的網站面板上進行任何設置...對我該如何做有任何建議嗎?
看看http://www.codeproject.com/Articles/6507/NET-Scheduled-Timer
它是安排重復功能的好工具。
如果您希望即使在關閉頁面后也要運行該程序,則必須在程序的頂層設置一個計時器。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.