Avatar of sachinjain_aspnet
sachinjain_aspnet

asked on 

function after every 2 second

I have a window application in c#, i want if any module like HR, Account, Admin run, it need to run a common function after every 2 second. Can you suggest me how to implement?
.NET Programming

Avatar of undefined
Last Comment
Mike Tomlinson
Avatar of Anuradha Goli
Anuradha Goli
Flag of Ireland image

Using System.Windows.Forms;

private Timer timer1; 
public void InitTimer()
{
    timer1 = new Timer();
    timer1.Tick += new EventHandler(timer1_Tick);
    timer1.Interval = 2000; // in milliseconds
    timer1.Start();
}

private void timer1_Tick(object sender, EventArgs e)
{
    isonline();
}

public void isonline()
    {
//       ----------------------
    }

Open in new window

Avatar of sachinjain_aspnet
sachinjain_aspnet

ASKER

Thats fine , but does i need to implement in every page of my appication ?
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo