Hi,
probably the question have been asked many times, but I can't find the
answer anywhere. Is there a way to detect if an internet connection is
active? just like Internet explorers detect you are offline when you try to
open it when not connected (then asks if you want to connect or work
offline). I need to detect if there is an internet connection available.
And if possible too (for another project) detect if a network connection
still work other than ping the main server (like know if the network cable
is not connected or adapter disabled and this kind of stuff)
Thanks
ThunderMusic 9 7244
In article <#n**************@TK2MSFTNGP15.phx.gbl>, ThunderMusic wrote: Hi, probably the question have been asked many times, but I can't find the answer anywhere. Is there a way to detect if an internet connection is active? just like Internet explorers detect you are offline when you try to open it when not connected (then asks if you want to connect or work offline). I need to detect if there is an internet connection available.
And if possible too (for another project) detect if a network connection still work other than ping the main server (like know if the network cable is not connected or adapter disabled and this kind of stuff)
Thanks
ThunderMusic http://vb.mvps.org/samples/project.asp?id=NetConnect
This is an example written in VB6 by Karl Peterson. Should be fairly
straight forward to convert to VB.NET.
--
Tom Shelton [MVP]
thanks, I'll give it a try.
"Tom Shelton" <to*@YOUKNOWTHEDRILLmtogden.com> a écrit dans le message de
news:uo**************@TK2MSFTNGP09.phx.gbl... In article <#n**************@TK2MSFTNGP15.phx.gbl>, ThunderMusic wrote: Hi, probably the question have been asked many times, but I can't find the answer anywhere. Is there a way to detect if an internet connection is active? just like Internet explorers detect you are offline when you try
to open it when not connected (then asks if you want to connect or work offline). I need to detect if there is an internet connection available.
And if possible too (for another project) detect if a network connection still work other than ping the main server (like know if the network
cable is not connected or adapter disabled and this kind of stuff)
Thanks
ThunderMusic
http://vb.mvps.org/samples/project.asp?id=NetConnect
This is an example written in VB6 by Karl Peterson. Should be fairly straight forward to convert to VB.NET.
-- Tom Shelton [MVP]
If you're developing a 2.0 app, then you can use
My.Computer.Network.Isavailable(). If you're using 1.1, then it's equivalent
is:
Imports System.Net.NetworkInformation
Public ReadOnly Property IsAvailable() As Boolean
Get
For Each NetInterface As NetworkInterface In _
NetworkInterface.GetAllNetworkInterfaces()
If NetInterface.Type <> InterfaceType.Loopback _
AndAlso NetInterface.Type <> InterfaceType.Tunnel _
AndAlso NetInterface.OperationalStatus = _
OperationalStatus.Up Then
Return True
End If
Next
Return False
End Get
End Property
Cathal
"ThunderMusic" <NO*******@sympatico.caSPAMATALL> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl... Hi, probably the question have been asked many times, but I can't find the answer anywhere. Is there a way to detect if an internet connection is active? just like Internet explorers detect you are offline when you try
to open it when not connected (then asks if you want to connect or work offline). I need to detect if there is an internet connection available.
And if possible too (for another project) detect if a network connection still work other than ping the main server (like know if the network cable is not connected or adapter disabled and this kind of stuff)
Thanks
ThunderMusic
ThunderMusic wrote: Hi, probably the question have been asked many times, but I can't find the answer anywhere. Is there a way to detect if an internet connection is active? just like Internet explorers detect you are offline when you try to open it when not connected (then asks if you want to connect or work offline). I need to detect if there is an internet connection available.
And if possible too (for another project) detect if a network connection still work other than ping the main server (like know if the network cable is not connected or adapter disabled and this kind of stuff)
Thanks
ThunderMusic
You can also use that code:
[DllImport("url.dll")]
public static extern bool InetIsOffline(int dwFlags);
public static bool IsOffline()
{
return InetIsOffline(0);
}
public static bool IsOnline()
{
return !InetIsOffline(0);
}
£ukasz
My VS 2003 cannot find the System.Net.NetworkInformation namespace. Do I
have to add a reference to something? and btw, it is not in the msdn
documentation.
thanks
"Cathal Connolly [VB MVP]" <cc*******@eg-consulting.com> a écrit dans le
message de news:eH**************@TK2MSFTNGP10.phx.gbl... If you're developing a 2.0 app, then you can use My.Computer.Network.Isavailable(). If you're using 1.1, then it's
equivalent is: Imports System.Net.NetworkInformation Public ReadOnly Property IsAvailable() As Boolean Get For Each NetInterface As NetworkInterface In _ NetworkInterface.GetAllNetworkInterfaces() If NetInterface.Type <> InterfaceType.Loopback _ AndAlso NetInterface.Type <> InterfaceType.Tunnel _ AndAlso NetInterface.OperationalStatus = _ OperationalStatus.Up Then Return True End If Next Return False End Get End Property
Cathal "ThunderMusic" <NO*******@sympatico.caSPAMATALL> wrote in message news:%2****************@TK2MSFTNGP15.phx.gbl... Hi, probably the question have been asked many times, but I can't find the answer anywhere. Is there a way to detect if an internet connection is active? just like Internet explorers detect you are offline when you try to open it when not connected (then asks if you want to connect or work offline). I need to detect if there is an internet connection available.
And if possible too (for another project) detect if a network connection still work other than ping the main server (like know if the network
cable is not connected or adapter disabled and this kind of stuff)
Thanks
ThunderMusic
ok, maybe something is missing because yesterday night I lost internet
connection and the way you provided me still detected my computer as
connected to the internet. Maybe there is some caching going on, but I don't
understand because the flag INTERNET_FLAG_NO_CACHE_WRITE is present... So Am
I missing something?
thanks for the information
ThunderMusic
"Tom Shelton" <to*@YOUKNOWTHEDRILLmtogden.com> a écrit dans le message de
news:uo**************@TK2MSFTNGP09.phx.gbl... In article <#n**************@TK2MSFTNGP15.phx.gbl>, ThunderMusic wrote: Hi, probably the question have been asked many times, but I can't find the answer anywhere. Is there a way to detect if an internet connection is active? just like Internet explorers detect you are offline when you try
to open it when not connected (then asks if you want to connect or work offline). I need to detect if there is an internet connection available.
And if possible too (for another project) detect if a network connection still work other than ping the main server (like know if the network
cable is not connected or adapter disabled and this kind of stuff)
Thanks
ThunderMusic
http://vb.mvps.org/samples/project.asp?id=NetConnect
This is an example written in VB6 by Karl Peterson. Should be fairly straight forward to convert to VB.NET.
-- Tom Shelton [MVP]
ok, with my searches, the System.Net.NetworkInformation namespace is in VS
2005... :(
"ThunderMusic" <NO*******@sympatico.caSPAMATALL> a écrit dans le message de
news:em***************@TK2MSFTNGP09.phx.gbl... My VS 2003 cannot find the System.Net.NetworkInformation namespace. Do I have to add a reference to something? and btw, it is not in the msdn documentation.
thanks
"Cathal Connolly [VB MVP]" <cc*******@eg-consulting.com> a écrit dans le message de news:eH**************@TK2MSFTNGP10.phx.gbl... If you're developing a 2.0 app, then you can use My.Computer.Network.Isavailable(). If you're using 1.1, then it's equivalent is: Imports System.Net.NetworkInformation Public ReadOnly Property IsAvailable() As Boolean Get For Each NetInterface As NetworkInterface In _ NetworkInterface.GetAllNetworkInterfaces() If NetInterface.Type <> InterfaceType.Loopback _ AndAlso NetInterface.Type <> InterfaceType.Tunnel _ AndAlso NetInterface.OperationalStatus = _ OperationalStatus.Up Then Return True End If Next Return False End Get End Property
Cathal "ThunderMusic" <NO*******@sympatico.caSPAMATALL> wrote in message news:%2****************@TK2MSFTNGP15.phx.gbl... Hi, probably the question have been asked many times, but I can't find the answer anywhere. Is there a way to detect if an internet connection is active? just like Internet explorers detect you are offline when you
try to open it when not connected (then asks if you want to connect or work offline). I need to detect if there is an internet connection
available. And if possible too (for another project) detect if a network
connection still work other than ping the main server (like know if the network
cable is not connected or adapter disabled and this kind of stuff)
Thanks
ThunderMusic
On Tue, 30 Aug 2005 12:07:53 -0400, ThunderMusic wrote: My VS 2003 cannot find the System.Net.NetworkInformation namespace. Do I have to add a reference to something? and btw, it is not in the msdn documentation.
Cathal Connolly's reply *began* with these words:
"Cathal Connolly [VB MVP]" <cc*******@eg-consulting.com> a écrit dans le message de news:eH**************@TK2MSFTNGP10.phx.gbl... If you're developing a 2.0 app, then you can use
"developing a 2.0 app" means using the .NET 2.0 framework, which would
generally imply using one of the VS.NET 2005 tools. (Although a madman
could be doing it entirely with the commandline compilers.)
yes but she added something afterward : If you're developing a 2.0 app, then you can use My.Computer.Network.Isavailable(). If you're using 1.1, then it's
equivalent is: Imports System.Net.NetworkInformation
So if I'm using 2.0, use Me.Computer.Network.Isavailable and if I'm using
1.1, then go for it's equivalent System.Net.NetworkInformation, which does
not seems to be in 1.1 is there an error in the name of the namespace or
just just tought this namespace was available to 1.1?
thanks
"Ross Presser" <rp******@NOSPAMgmail.com.invalid> a écrit dans le message de
news:v2**************@rosspresser.dyndns.org... On Tue, 30 Aug 2005 12:07:53 -0400, ThunderMusic wrote:
My VS 2003 cannot find the System.Net.NetworkInformation namespace. Do I have to add a reference to something? and btw, it is not in the msdn documentation.
Cathal Connolly's reply *began* with these words:
"Cathal Connolly [VB MVP]" <cc*******@eg-consulting.com> a écrit dans le message de news:eH**************@TK2MSFTNGP10.phx.gbl... If you're developing a 2.0 app, then you can use
"developing a 2.0 app" means using the .NET 2.0 framework, which would generally imply using one of the VS.NET 2005 tools. (Although a madman could be doing it entirely with the commandline compilers.) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Yurij Nykon |
last post by:
Hi all.
How can I detect the version of Flash-Plugin installed in Internet
Explorer?
In Netscape i can do this with following java script
navigator.plugins.description
But it doesn't works...
|
by: Tim Johnson |
last post by:
Hello All:
Using javascript to dynamically add row elements to a table.
as in .....
row.setAttribute("bgcolor",rowColor);
// or
cell.setAttribute("bgcolor",rowColor);
Using firefox or...
|
by: Peter Flynn |
last post by:
I'm having trouble finding example code to detect the presence of
an Internet connection. It doesn't seem to be a very frequently
asked question, as all I need is the answer yes or no (is the user...
|
by: the6campbells |
last post by:
Vendors such as ORACLE document how they support the server being
configured to provide dead connection detection. I see no
documentation in the IBM manuals or support site notes that suggest
that...
|
by: Raphi |
last post by:
Hi,
I've been using an Access application I wrote for an office with the
front-end stored on all computers and the back-end on one of them serving as
an Access file server.
Now we're moving...
|
by: ThunderMusic |
last post by:
Hi,
probably the question have been asked many times, but I can't find the
answer anywhere. Is there a way to detect if an internet connection is
active? just like Internet explorers detect you...
|
by: ezmiller |
last post by:
Does anybody know how to use javascript to test whether or not an
internet connection exists? Is this possible even?
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |