Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6582415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:16:38+00:00 2026-05-25T16:16:38+00:00

Possible Duplicate: C# Execute function at specific time I want to run certain function

  • 0

Possible Duplicate:
C# Execute function at specific time

I want to run certain function at certain time.I tried Timer control.it’s not working. My question is:How can I run a function every day at the 19:00 in C#?
Is there any way to check the time and have a Timer object?

Timer code:

int Interval(TimeSpan gorevZamani)
{
    if ((gorevZamani - DateTime.Now.TimeOfDay).TotalMilliseconds > 0.0)
        return (int)(gorevZamani - DateTime.Now.TimeOfDay).TotalMilliseconds;
    else
        return (int)((gorevZamani - DateTime.Now.TimeOfDay).Add(TimeSpan.FromDays(1)).TotalMilliseconds);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:16:39+00:00Added an answer on May 25, 2026 at 4:16 pm

    in the question set as possible duplicate: C# Execute function at specific time people suggest to use either Quartz.NET or windows Task Scheduler.

    Both options could eventually serve the purpose but I believe, as I suggested already few times in similar previous questions, Windows Task Scheduler is better because you no code anything for it and let Windows do the scheduling for you and you focus only on the real business case of your application, which is what Windows cannot do for you, then rely on existing technologies to glue things together and don’t have to debug or reinvent what has been done and is available for you anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: JavaScript alert not working in Firefox 6 I often execute Javascript code
Possible Duplicate: Why an executable program for a specific CPU does not work on
Possible Duplicate: JavaScript: immediate function invocation syntax A similar question has been asked here
Possible Duplicate: Collection was modified; enumeration operation may not execute HI there, I am
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
Possible Duplicate: JavaScript: var functionName = function() {} vs function functionName() {} What's the
Possible Duplicate: Why does C# execute Math.Sqrt() more slowly than VB.NET? I'm running into
Possible Duplicate: How to execute an .SQL script file using c# How would I
Possible Duplicate: Location of parenthesis for auto-executing anonymous JavaScript functions? Sometimes I see: (function()
Possible Duplicate: How does foreach work when looping through function results? Title has the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.