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 3407492
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:45:27+00:00 2026-05-18T05:45:27+00:00

I have an application that I need to automate where at a certain time

  • 0

I have an application that I need to automate where at a certain time each day, say 6pm, it will run a certain method(which is to check a database for key terms and then access the api to search for these terms). But there is also another process which is running all the time accessing the stream api so when the search is complete, it interrupts the stream and hands over the new terms.
Now I thought of adding the .exe file to windows task scheduler but not sure if that would work. The stream method run indefinitely and at 6pm each day another process needs to run. I thought of using the system.threading.task TaskFactory but when I include it, it shows taskfactory as undefined. ( I do have .net framework 4.0)If it launches using the task scheduler as 6pm with my code logic as follows:

        While True
            'should i run this method as background 
            dim gStream as StreamProcess
            gStream.module1()


            If DateTime.Now.TimeOfDay.ToString = searchTime Then
                addKeywordSearchRules = getSTerms.getNewTerms(addKeywordSearchRules)
                ruleManip.ruleChanges(ruleMethods.Method.ADD, addKeywordSearchRules)
            End If

            Dim gSearch As SearchProcess
            if not addKeywordSearchRules.count = 0 then
               gSearch.module1()
            end if 

        End While

Does this logic make sense? Any other ideas>

  • 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-18T05:45:28+00:00Added an answer on May 18, 2026 at 5:45 am

    An alternative would be to use a system.windows.forms.timer object.

    1. Place the timer object on your form
    2. Set the “Enabled” property to True
    3. Set the “Interval” property to 24hrs, i.e (24 * 60 * 60 * 1000, because the unit is milliseconds)
    4. In the “tick” event of the Timer object, set it to run whatever function you want to be executed every 24 hours.

    i.e do something like the following, assuming your Timer object is called Timer1:

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        'run your desired function here
    End Sub
    

    Hope that helps.

    EDIT: The following is sample code to make this work in a console application…

    Imports System.Windows.Forms
    Module Module1
        Public WithEvents timer As New System.Windows.Forms.Timer
        Sub Main()
            timer.Enabled = True
            timer.Interval = 500 'replace 500 milliseconds with 24 hours'
            MsgBox("pause")
        End Sub
    
        Private Sub Timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timer.Tick
            'run your desired method here'
        End Sub
    
    End Module
    

    The minor differences are:

    1. You have to explicitly import
      System.Windows.Forms
    2. Within your module, you have to
      declare the timer as WithEvents, so that your module gets notified of the “Tick” event

    You can import system.windows.forms by first double-clicking on “My project” in your project explorer, then going to “References”, then clicking on “Add”, then choosing the “.Net” tab and choosing System.windows.forms. I hope those are the right english names, because I am using visual studio in a different language.

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

Sidebar

Related Questions

I have an application that when it first starts i need it to run
I have an application that runs here http://localhost:10205/ but I need it run locally
I have a console application that require to use some code that need administrator
I have an application running on multiple IIS servers that need to parse a
We are creating an XBAP application that we need to have rounded corners in
I have an application that has Powershell 1 embedded into it, but we need
I have an application (an IP conferencing service) that I need to scale. It
I have a web application that I'm writing (C#, MSSQL) and I need to
I have a paint application that runs as a Java applet. I need to
Suppose you have two seperate ASP.NET Web Application projects that both need to use

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.