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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:51:28+00:00 2026-05-26T11:51:28+00:00

My program starts with windows startup, But a background worker is supposed to work

  • 0

My program starts with windows startup,
But a background worker is supposed to work instantly after the program is opened.
But it starts with a delay and then even returns false signs(it returns if a site is up),
Only after about 15 seconds the background-worker continues to work normally and the program too. I think this is because of .net framework trying to load, or internet connection that is not up yet, or something that didn’t load yet(windows startup).
What can solve this, and what is the probable cause? (WinForm C#)

Edit:
Here is something I thought of,
I don’t think though that this is a good practice. Is there a better way?
(Load method):

    while (!netConnection())
    {
    }
    if(netConnection())
    bwCheck.RunWorkerAsync();
  • 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-26T11:51:28+00:00Added an answer on May 26, 2026 at 11:51 am

    I think this is because of .net framework trying to load

    Nope. If that were the case your program wouldn’t run.

    or internet connection that is not up yet, or

    Yup. The network card/interface/connection/whatever is not initialized and connected to the internet yet. You can’t expect a PC to be connected to the internet immediately at startup. Even more, what if your customer is on a domain using network authentication? What if they delay network communications until some task is complete (this was actually the problem in my case below. Seriously.)

    It may take even longer to get it up and running in that case (read: don’t add a Thread.Sleep() in a vain attempt to ‘fix’ the issue.

    I had to fix a problem like this once in a systems design where we communicated to a motion control board via the ethernet bus in a PC. I ended up adding some code to monitor the status of the network connection and, only when it was established, started talking to the device via the network card.

    EDIT: As SLaks pointed out in the comments, this is pretty simple in C#: The NetworkAvailabilityChanged event for your programming pleasure.

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

Sidebar

Related Questions

I need to add the Run when Windows starts option to my program CintaNotes,
On Windows Vista, with UAC enabled, everytime a program that requires administrative priviledges starts,
I want to make a script that starts a program and then sends it
I want to start a simple program when windows start but I don't want
When I try to set C:\windows\System32\inetsrv\InetMgr.exe as the startup program for a Visual Studio
Is there any reason to start a GUI program (application for Windows) written in
When the program starts, a new JFrame is created. Once the user clicks the
For the moment my batch file look like this: myprogram.exe param1 The program starts
I have a program that starts up and creates an in-memory data model and
I have a program that when it starts, opens a winform (it is 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.