423,688 Members | 1,894 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,688 IT Pros & Developers. It's quick & easy.

Working online

P: n/a
Hello group,

I need to know the best and best responsive way to determinate is a windows
form (or the desktop computer) is online (access to internet).

I particularly interested for a quick check.

TIA

MajorTom
Nov 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
You can make an HTTP Request for instance and see if you get a response.
http://www.knowdotnet.com/articles/a...ynccradle.html
http://www.devbuzz.com/content/zinc_...tivity_pg1.asp

Although the last method I reference in each article is used in reference to
determining if a PDA is cradled, the first example in each article shows you
how to use the HTTP Request - but you can use many similar approaches. A
more direct approach though involves P/Invoking IsDestinationReachable if
you are comfortable P/Invoking stuff (and if you aren't - trust me, there's
nothign to be afraid of)
[DllImport("sensapi.dll")]
private extern static bool IsDestinationReachable(string dest,IntPtr ptr);

bool HasConnectivity =
IsDestinationReachable(www.msmvps.com/WilliamRyan,IntPtr.Zero);

--
W.G. Ryan MVP Windows - Embedded

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/...ity/newsgroups
"MajorTom" <m.********@NOverizon.net.do> wrote in message
news:u3***************@tk2msftngp13.phx.gbl...
Hello group,

I need to know the best and best responsive way to determinate is a windows form (or the desktop computer) is online (access to internet).

I particularly interested for a quick check.

TIA

MajorTom

Nov 16 '05 #2

P: n/a
Thanks, I use the P/Invoking , I trust you.

now a few questions:

Is my application dependable of something more than the framework when I use
the [DllImport("sensapi.dll")] ?

Is there a way to get a respond more rapid, I know that I have to wait for
the timeout. How that works ?

Thank very much for your response

Major Tom

"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:e$*************@TK2MSFTNGP10.phx.gbl...
You can make an HTTP Request for instance and see if you get a response.
http://www.knowdotnet.com/articles/a...ynccradle.html
http://www.devbuzz.com/content/zinc_...tivity_pg1.asp

Although the last method I reference in each article is used in reference to determining if a PDA is cradled, the first example in each article shows you how to use the HTTP Request - but you can use many similar approaches. A
more direct approach though involves P/Invoking IsDestinationReachable if
you are comfortable P/Invoking stuff (and if you aren't - trust me, there's nothign to be afraid of
[DllImport("sensapi.dll")]
private extern static bool IsDestinationReachable(string dest,IntPtr ptr);

bool HasConnectivity =
IsDestinationReachable(www.msmvps.com/WilliamRyan,IntPtr.Zero);

--
W.G. Ryan MVP Windows - Embedded

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/...ity/newsgroups
"MajorTom" <m.********@NOverizon.net.do> wrote in message
news:u3***************@tk2msftngp13.phx.gbl...
Hello group,

I need to know the best and best responsive way to determinate is a

windows
form (or the desktop computer) is online (access to internet).

I particularly interested for a quick check.

TIA

MajorTom


Nov 16 '05 #3

P: n/a
Another option is to use InternetGetConnectedState() API. Refer to this for
a simple example:
http://www.c-sharpcorner.com/Code/20...Connection.asp

HTH.

"MajorTom" <m.********@NOverizon.net.do> wrote in message
news:u3*************@tk2msftngp13.phx.gbl...
Hello group,

I need to know the best and best responsive way to determinate is a windows
form (or the desktop computer) is online (access to internet).

I particularly interested for a quick check.

TIA

MajorTom

Nov 16 '05 #4

P: n/a
Thanks I will have it in my arsenal

MajorTom

"Shiva" <sh******@online.excite.com> wrote in message
news:Oj**************@TK2MSFTNGP12.phx.gbl...
Another option is to use InternetGetConnectedState() API. Refer to this for a simple example:
http://www.c-sharpcorner.com/Code/20...Connection.asp

HTH.

"MajorTom" <m.********@NOverizon.net.do> wrote in message
news:u3*************@tk2msftngp13.phx.gbl...
Hello group,

I need to know the best and best responsive way to determinate is a windows form (or the desktop computer) is online (access to internet).

I particularly interested for a quick check.

TIA

MajorTom

Nov 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.