How to call a method once time in a day in asp.net c#
Many times we need to call a method once time in a day.
In this article we have mentioned the code for this.
Source Code:-
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
public partial class onedaymethod :
System.Web.UI.Page
{
static DateTime
objdatetime;
protected void
Page_Load(object sender, EventArgs e)
{
if
(objdatetime == DateTime.Today)
{
//this method call everythime in a day
Response.Write("this
message show everytime in a day");
return;
}
objdatetime = DateTime.Today;
//this method call only one
time in a day
Response.Write("this
message show only time in a day");
}
}
How to call a method once time in a day in asp.net c#
Reviewed by NEERAJ SRIVASTAVA
on
5:11:00 PM
Rating:
No comments: