简体   繁体   English

如何在一段时间内自动调用我的方法而无需在ASP.net C#中的应用程序中运行任何WebPage?

[英]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.

相关问题 C#,ASP.NET如何在我的Controller的任何方法的每次调用期间调用方法 - C#, ASP.NET how to call method during each call of any method of my Controller 我如何在c#asp.net应用程序中使用jquery实现文本框自动建议? - How can i implement textbox auto suggest using jquery in my c# asp.net application? 如何在ASP.NET C#中注销我的应用程序? - how to logout my application in asp.net c#? 将实时视频从我的 c# 应用程序流式传输到 ASP.NET 网页 - Streaming live video from my c# application to ASP.NET webpage 如何从asp:Button的OnCommand中的另一个文件调用方法? asp.net C# - How do I call a Method from another file in OnCommand of my asp:Button? asp.net C# 我的web应用程序在哪个端口上运行asp.net C# - On which port my web application is running asp.net C# c# asp.net 内核等待长时间运行的任务在一段时间后停止 - c# asp.net core awaiting long running task stops after period of time 如何在C#中的ASP.NET应用程序中调用Web方法? - How can I call my webmethod in my ASP.NET app in c#? 如何使我的ASP.NET应用程序可在任何主机上安装 - How to make my ASP.NET Application Installable on any host 如何在ASP.NET C#中通过Timer调用方法? - How to call a method by Timer in asp.net c#?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM