在asp.net Web应用程序中一天只运行一次方法 [英] run a method only one time in a day in asp.net web application

查看:99
本文介绍了在asp.net Web应用程序中一天只运行一次方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..



如何在asp.net Web应用程序中一天只运行一次方法(或一个线程)。



方法与gridview有关。

Hi..

How to run a method (or a thread) only once in a day in asp.net web application.

Method is related to gridview.

推荐答案

试试这段代码。



Try this code.

//Declare this at you class level
static DateTime dummy;

//You this logig within your method.
if (dummy == DateTime.Today)
{
         return;
}
     dummy = DateTime.Today;
//Put your code here.
}


请参阅此链接,我回答了有关如何按预定义的时间间隔执行某些任务的问题。



在特殊时间执行某些任务 [ ^ ]



问候......:笑:
Refer to this link where i answered question on how to do some tasks at predefined time interval.

Doing Some tasks at special times[^]

Regards..:laugh:


这篇关于在asp.net Web应用程序中一天只运行一次方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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