.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Kaviya Balasubramanian
Sgraph Infotech
Imran Ghani

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

Background Worker With Timer in C#.Net

Posted By: Narayanan     Posted Date: August 16, 2011    Points:5   Category :C#
Hi friends,
I am using Background worker and Timer in my Project.Where can i start timer in the Background worker?
Scenario:File Processing (send and received Concept)File Transfer from Source path to Designation path using Backgroundworker with Timer in C#.net.Please tell me .Thanks for your attention
Lakshmi Narayanan.S

Author: Narayanan             
Posted Date: August 17, 2011     Points: 20   

Thanks for your link

Regards, Lakshmi Naraayanan.S
Author: Gowthammanju             
Posted Date: August 17, 2011     Points: 20   

try these coding as

create function named ss as

private void ss(object sender, DoWorkEventArgs e)
BackgroundWorker worker = sender as BackgroundWorker;
int delay = 1000; // 1 second
while (!worker.CancellationPending)
do something
e.Cancel = true;

then check whether it works r not by

int delay = 1000; // 1 second
int interval = 60000;
int elapsed = 0;
while (!worker.CancellationPending)
elapsed = 0;
do something
while (elapsed < interval && !worker.CancellationPending)
e.Cancel = true;

Thanks & Regards,

Mark if the answer is true

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend