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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:01:08+00:00 2026-05-11T04:01:08+00:00

I wish to write a windows app which does something when I become disconnected

  • 0

I wish to write a windows app which does something when I become disconnected from the internet. I was thinking of writing a very simple C#/Delphi app which simply polls every 20 seconds to see if I’m still connected.

If I have to poll I’d really like a solution other than trying to download a web page from the net. I can’t assume that a download attempt failing means ‘not online’ since there may be other apps eating up the internet bandwidth. Plus I’m sure constantly connecting/downloading from a particular site is going to get my IP blocked.

I’m sure there’s a way to tell if you’re online without downloading/connecting to a remote server but I’m not sure how.

  • 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. 2026-05-11T04:01:09+00:00Added an answer on May 11, 2026 at 4:01 am

    Beware that connected to the Internet does not really mean anything: what if you are connected to your ISP, but the backbone is down, or all the sites you want to access are in a country that went off the grid like recently? Having a connection does not mean you can do what you want.
    Anyway, as stated before you can use the InternetGetConnectedState API to test that you have a valid Internet connection configured.
    As an example, the following routine told me correctly I had a LAN Connection, but failed to detect that I had my ZoneAlarm firewall set to block ‘All Internet Activity’, which means that you effectively lost all Internet connectivity.

    Delphi routine:

    procedure IsConnected; var   dwFlags: DWORD; begin   if InternetGetConnectedState(@dwFlags, 0) then   begin     if (dwFlags and INTERNET_CONNECTION_MODEM) = INTERNET_CONNECTION_MODEM  then       ShowMessage('Modem Connection')     else     if (dwFlags and INTERNET_CONNECTION_LAN) = INTERNET_CONNECTION_LAN then       ShowMessage('LAN Connection')     else     if (dwFlags and INTERNET_CONNECTION_PROXY) = INTERNET_CONNECTION_PROXY then       ShowMessage('Connection thru Proxy')     else     if (dwFlags and INTERNET_CONNECTION_OFFLINE) = INTERNET_CONNECTION_OFFLINE then       ShowMessage('Local system in offline mode')     else     if (dwFlags and INTERNET_CONNECTION_CONFIGURED) = INTERNET_CONNECTION_CONFIGURED then       ShowMessage('Valid connection exists, but might or might not be connected')   end   else     ShowMessage('Not Connected. Try to connect and risk of being prompted to dial into another Internet Service Provider.'); end; 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 101k
  • Answers 101k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use this extension: http://launchpad.net/bzr-keywords May 11, 2026 at 8:05 pm
  • Editorial Team
    Editorial Team added an answer Yes, your assumption is correct. The 2GB limit applies to… May 11, 2026 at 8:05 pm
  • Editorial Team
    Editorial Team added an answer To do this use either HOST_NAME() or SUSER_SNAME() to filter… May 11, 2026 at 8:05 pm

Related Questions

I wish to write a windows service in .Net 2.0 that listens to and
I have to write a Windows Service application (no GUI) that will monitor an
I am developing a log parsing service that captures specific security events in the
I am creating a downloading application and I wish to preallocate room on the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.