473,513 Members | 2,688 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Network Connection

Hi,
I'm using my with a program to detect an internet connection.
It return true when I'm connected, but even when I 'm disconnected it
returns true
I don't know why ?
Thx
Omar Abid

Jun 12 '07 #1
14 2972
Omar Abid wrote:
Hi,
I'm using my with a program to detect an internet connection.
It return true when I'm connected, but even when I 'm disconnected it
returns true
I don't know why ?
Thx
Omar Abid
What command are you using?
Jun 12 '07 #2
On 12 juin, 13:43, Chris Diver <chris.di...@hotmail.co.ukwrote:
Omar Abid wrote:
Hi,
I'm using my with a program to detect an internet connection.
It return true when I'm connected, but even when I 'm disconnected it
returns true
I don't know why ?
Thx
Omar Abid

What command are you using?
my.network

Jun 12 '07 #3
Omar Abid wrote:
On 12 juin, 13:43, Chris Diver <chris.di...@hotmail.co.ukwrote:
>Omar Abid wrote:
>>Hi,
I'm using my with a program to detect an internet connection.
It return true when I'm connected, but even when I 'm disconnected it
returns true
I don't know why ?
Thx
Omar Abid
What command are you using?

my.network
My.Computer.Network.IsAvailable works fine for me, although I just have
a single connection to a LAN.

You could always ping a few popular addresses to see if you have an
Internet connection. E.G www.google.com, www.microsoft.com,
www.yahoo.com its unlikely that they will all be down at the same time.

You could send a webrequest in a try/catch statement, if it throws an
exception then there is a problem connecting to the internet and you are
not connected.

Also not having an active Internet connection doesn't mean that you are
not connected to a Network.

HTH,
Chris
Jun 12 '07 #4
On Jun 12, 8:03 am, Omar Abid <omar.abid2...@gmail.comwrote:
On 12 juin, 13:43, Chris Diver <chris.di...@hotmail.co.ukwrote:
Omar Abid wrote:
Hi,
I'm using my with a program to detect an internet connection.
It return true when I'm connected, but even when I 'm disconnected it
returns true
I don't know why ?
Thx
Omar Abid
What command are you using?

my.network
my.network
I assuming you mean My.Computer.Network.IsAvailable()? If so I
wouldn't use it to determine and internet connection, but rather I
would use My.Computer.Network.Ping("www.google.com") - It will return
true only if the ping goes through - and not just if the computer is
talking to a network.

Thanks,

Seth Rowe

Jun 12 '07 #5
On Jun 12, 8:35 am, Chris Diver <chris.di...@hotmail.co.ukwrote:
Omar Abid wrote:
On 12 juin, 13:43, Chris Diver <chris.di...@hotmail.co.ukwrote:
Omar Abid wrote:
Hi,
I'm using my with a program to detect an internet connection.
It return true when I'm connected, but even when I 'm disconnected it
returns true
I don't know why ?
Thx
Omar Abid
What command are you using?
my.network

My.Computer.Network.IsAvailable works fine for me, although I just have
a single connection to a LAN.

You could always ping a few popular addresses to see if you have an
Internet connection. E.Gwww.google.com,www.microsoft.com,www.yahoo.comits unlikely that they will all be down at the same time.

You could send a webrequest in a try/catch statement, if it throws an
exception then there is a problem connecting to the internet and you are
not connected.

Also not having an active Internet connection doesn't mean that you are
not connected to a Network.

HTH,
Chris
You could always ping a few popular addresses to see if you have an
Internet connection. E.Gwww.google.com,www.microsoft.com,www.yahoo.comits unlikely that they will all be down at the same time.
Well, except for microsoft.com - I believe it's servers are configured
to refuse ping requests.

Thanks,

Seth Rowe

Jun 12 '07 #6
rowe_newsgroups wrote:
On Jun 12, 8:35 am, Chris Diver <chris.di...@hotmail.co.ukwrote:
>Omar Abid wrote:
>>On 12 juin, 13:43, Chris Diver <chris.di...@hotmail.co.ukwrote:
Omar Abid wrote:
Hi,
I'm using my with a program to detect an internet connection.
It return true when I'm connected, but even when I 'm disconnected it
returns true
I don't know why ?
Thx
Omar Abid
What command are you using?
my.network
My.Computer.Network.IsAvailable works fine for me, although I just have
a single connection to a LAN.

You could always ping a few popular addresses to see if you have an
Internet connection. E.Gwww.google.com,www.microsoft.com,www.yahoo.comits unlikely that they will all be down at the same time.

You could send a webrequest in a try/catch statement, if it throws an
exception then there is a problem connecting to the internet and you are
not connected.

Also not having an active Internet connection doesn't mean that you are
not connected to a Network.

HTH,
Chris

>You could always ping a few popular addresses to see if you have an
Internet connection. E.Gwww.google.com,www.microsoft.com,www.yahoo.comits unlikely that they will all be down at the same time.

Well, except for microsoft.com - I believe it's servers are configured
to refuse ping requests.

Thanks,

Seth Rowe
Cool, didn't know that.
Jun 12 '07 #7
On 12 juin, 14:52, Chris Diver <chris.di...@hotmail.co.ukwrote:
rowe_newsgroups wrote:
On Jun 12, 8:35 am, Chris Diver <chris.di...@hotmail.co.ukwrote:
Omar Abid wrote:
On 12 juin, 13:43, Chris Diver <chris.di...@hotmail.co.ukwrote:
Omar Abid wrote:
Hi,
I'm using my with a program to detect an internet connection.
It return true when I'm connected, but even when I 'm disconnected it
returns true
I don't know why ?
Thx
Omar Abid
What command are you using?
my.network
My.Computer.Network.IsAvailable works fine for me, although I just have
a single connection to a LAN.
You could always ping a few popular addresses to see if you have an
Internet connection. E.Gwww.google.com,www.microsoft.com,www.yahoo.comitsunlikely that they will all be down at the same time.
You could send a webrequest in a try/catch statement, if it throws an
exception then there is a problem connecting to the internet and you are
not connected.
Also not having an active Internet connection doesn't mean that you are
not connected to a Network.
HTH,
Chris
You could always ping a few popular addresses to see if you have an
Internet connection. E.Gwww.google.com,www.microsoft.com,www.yahoo.comitsunlikely that they will all be down at the same time.
Well, except for microsoft.com - I believe it's servers are configured
to refuse ping requests.
Thanks,
Seth Rowe

Cool, didn't know that.
The problem isn' t solved.
Notice that i have several servers on my PC, does that change the
connection ?

Jun 12 '07 #8
On Jun 12, 11:19 am, Omar Abid <omar.abid2...@gmail.comwrote:
On 12 juin, 14:52, Chris Diver <chris.di...@hotmail.co.ukwrote:
rowe_newsgroups wrote:
On Jun 12, 8:35 am, Chris Diver <chris.di...@hotmail.co.ukwrote:
>Omar Abid wrote:
>>On 12 juin, 13:43, Chris Diver <chris.di...@hotmail.co.ukwrote:
>>>Omar Abid wrote:
>>>>Hi,
>>>>I'm using my with a program to detect an internet connection.
>>>>It return true when I'm connected, but even when I 'm disconnected it
>>>>returns true
>>>>I don't know why ?
>>>>Thx
>>>>Omar Abid
>>>What command are you using?
>>my.network
>My.Computer.Network.IsAvailable works fine for me, although I just have
>a single connection to a LAN.
>You could always ping a few popular addresses to see if you have an
>Internet connection. E.Gwww.google.com,www.microsoft.com,www.yahoo.comitsunlikelythat they will all be down at the same time.
>You could send a webrequest in a try/catch statement, if it throws an
>exception then there is a problem connecting to the internet and you are
>not connected.
>Also not having an active Internet connection doesn't mean that you are
>not connected to a Network.
>HTH,
>Chris
>You could always ping a few popular addresses to see if you have an
>Internet connection. E.Gwww.google.com,www.microsoft.com,www.yahoo.comitsunlikelythat they will all be down at the same time.
Well, except for microsoft.com - I believe it's servers are configured
to refuse ping requests.
Thanks,
Seth Rowe
Cool, didn't know that.

The problem isn' t solved.
Notice that i have several servers on my PC, does that change the
connection ?
You mean it's pinging fine? Even when not connected?

Thanks,

Seth Rowe

Jun 12 '07 #9
On 12 juin, 17:24, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Jun 12, 11:19 am, Omar Abid <omar.abid2...@gmail.comwrote:
On 12 juin, 14:52, Chris Diver <chris.di...@hotmail.co.ukwrote:
rowe_newsgroups wrote:
On Jun 12, 8:35 am, Chris Diver <chris.di...@hotmail.co.ukwrote:
Omar Abid wrote:
>On 12 juin, 13:43, Chris Diver <chris.di...@hotmail.co.ukwrote:
>>Omar Abid wrote:
>>>Hi,
>>>I'm using my with a program to detect an internet connection.
>>>It return true when I'm connected, but even when I 'm disconnected it
>>>returns true
>>>I don't know why ?
>>>Thx
>>>Omar Abid
>>What command are you using?
>my.network
My.Computer.Network.IsAvailable works fine for me, although I just have
a single connection to a LAN.
You could always ping a few popular addresses to see if you have an
Internet connection. E.Gwww.google.com,http://www.microsoft.com,www.yahoo.c...likelythatthey will all be down at the same time.
You could send a webrequest in a try/catch statement, if it throws an
exception then there is a problem connecting to the internet and you are
not connected.
Also not having an active Internet connection doesn't mean that you are
not connected to a Network.
HTH,
Chris
You could always ping a few popular addresses to see if you have an
Internet connection. E.Gwww.google.com,http://www.microsoft.com,www.yahoo.c...likelythatthey will all be down at the same time.
Well, except for microsoft.com - I believe it's servers are configured
to refuse ping requests.
Thanks,
Seth Rowe
Cool, didn't know that.
The problem isn' t solved.
Notice that i have several servers on my PC, does that change the
connection ?

You mean it's pinging fine? Even when not connected?

Thanks,

Seth Rowe
No it don't ping
but my.computer.network.isavailable = true even when I'm not connected

Jun 12 '07 #10
>
The problem isn' t solved.
Notice that i have several servers on my PC, does that change the
connection ?
I don't understand either?
Private Funtion IsConnectedToInternet() as Boolean
Try 'Not sure if this is necessary
If My.Computer.Network.Ping("www.google.com") = False Then
If My.Computer.Network.Ping("www.yahoo.com") = False Then
'NOT CONNECTED TO THE INTERNET
Return False
End If
End If
Catch Ex as Exception
'SOMETHING WRONG HAPPENED NOT CONNECTED
Return False
End Try
'YOU ARE CONNECTED TO THE INTERNET
Return True
End Function

Or

Private Function IsConnectedToInternet() As Boolean
Return My.Computer.Network.Ping("www.google.com")
End Function

Does that not solve your problem?
Jun 12 '07 #11
Omar Abid wrote:
On 12 juin, 17:24, rowe_newsgroups <rowe_em...@yahoo.comwrote:
>On Jun 12, 11:19 am, Omar Abid <omar.abid2...@gmail.comwrote:
>>On 12 juin, 14:52, Chris Diver <chris.di...@hotmail.co.ukwrote:
rowe_newsgroups wrote:
On Jun 12, 8:35 am, Chris Diver <chris.di...@hotmail.co.ukwrote:
>Omar Abid wrote:
>>On 12 juin, 13:43, Chris Diver <chris.di...@hotmail.co.ukwrote:
>>>Omar Abid wrote:
>>>>Hi,
>>>>I'm using my with a program to detect an internet connection.
>>>>It return true when I'm connected, but even when I 'm disconnected it
>>>>returns true
>>>>I don't know why ?
>>>>Thx
>>>>Omar Abid
>>>What command are you using?
>>my.network
>My.Computer.Network.IsAvailable works fine for me, although I just have
>a single connection to a LAN.
>You could always ping a few popular addresses to see if you have an
>Internet connection. E.Gwww.google.com,http://www.microsoft.com,www.yahoo.c...likelythatthey will all be down at the same time.
>You could send a webrequest in a try/catch statement, if it throws an
>exception then there is a problem connecting to the internet and you are
>not connected.
>Also not having an active Internet connection doesn't mean that you are
>not connected to a Network.
>HTH,
>Chris
>You could always ping a few popular addresses to see if you have an
>Internet connection. E.Gwww.google.com,http://www.microsoft.com,www.yahoo.c...likelythatthey will all be down at the same time.
Well, except for microsoft.com - I believe it's servers are configured
to refuse ping requests.
Thanks,
Seth Rowe
Cool, didn't know that.
The problem isn' t solved.
Notice that i have several servers on my PC, does that change the
connection ?
You mean it's pinging fine? Even when not connected?

Thanks,

Seth Rowe

No it don't ping
but my.computer.network.isavailable = true even when I'm not connected
Your probably connected to a network but not the Internet.
Jun 12 '07 #12
On Jun 12, 11:39 am, Omar Abid <omar.abid2...@gmail.comwrote:
On 12 juin, 17:24, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Jun 12, 11:19 am, Omar Abid <omar.abid2...@gmail.comwrote:
On 12 juin, 14:52, Chris Diver <chris.di...@hotmail.co.ukwrote:
rowe_newsgroups wrote:
On Jun 12, 8:35 am, Chris Diver <chris.di...@hotmail.co.ukwrote:
>Omar Abid wrote:
>>On 12 juin, 13:43, Chris Diver <chris.di...@hotmail.co.ukwrote:
>>>Omar Abid wrote:
>>>>Hi,
>>>>I'm using my with a program to detect an internet connection.
>>>>It return true when I'm connected, but even when I 'm disconnected it
>>>>returns true
>>>>I don't know why ?
>>>>Thx
>>>>Omar Abid
>>>What command are you using?
>>my.network
>My.Computer.Network.IsAvailable works fine for me, although I just have
>a single connection to a LAN.
>You could always ping a few popular addresses to see if you have an
>Internet connection. E.Gwww.google.com,http://www.microsoft.com,www.yahoo.c...lythattheywill all be down at the same time.
>You could send a webrequest in a try/catch statement, if it throws an
>exception then there is a problem connecting to the internet and you are
>not connected.
>Also not having an active Internet connection doesn't mean that you are
>not connected to a Network.
>HTH,
>Chris
>You could always ping a few popular addresses to see if you have an
>Internet connection. E.Gwww.google.com,http://www.microsoft.com,www.yahoo.c...lythattheywill all be down at the same time.
Well, except for microsoft.com - I believe it's servers are configured
to refuse ping requests.
Thanks,
Seth Rowe
Cool, didn't know that.
The problem isn' t solved.
Notice that i have several servers on my PC, does that change the
connection ?
You mean it's pinging fine? Even when not connected?
Thanks,
Seth Rowe

No it don't ping
but my.computer.network.isavailable = true even when I'm not connected
I don't think you understood me then - I said to not use
Network.IsAvailable but to use Network.Ping. Networks are different
than internet connections - so Network.IsAvailable will not always
work.

Thanks,

Seth Rowe

Jun 12 '07 #13
On 12 juin, 17:39, Chris Diver <chris.di...@hotmail.co.ukwrote:
The problem isn' t solved.
Notice that i have several servers on my PC, does that change the
connection ?

I don't understand either?

Private Funtion IsConnectedToInternet() as Boolean
Try 'Not sure if this is necessary
If My.Computer.Network.Ping("www.google.com") = False Then
If My.Computer.Network.Ping("www.yahoo.com") = False Then
'NOT CONNECTED TO THE INTERNET
Return False
End If
End If
Catch Ex as Exception
'SOMETHING WRONG HAPPENED NOT CONNECTED
Return False
End Try
'YOU ARE CONNECTED TO THE INTERNET
Return True
End Function

Or

Private Function IsConnectedToInternet() As Boolean
Return My.Computer.Network.Ping("www.google.com")
End Function

Does that not solve your problem?
That's work fine with me Thx

Jun 12 '07 #14
On 12 juin, 18:38, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Jun 12, 11:39 am, Omar Abid <omar.abid2...@gmail.comwrote:


On 12 juin, 17:24, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Jun 12, 11:19 am, Omar Abid <omar.abid2...@gmail.comwrote:
On 12 juin, 14:52, Chris Diver <chris.di...@hotmail.co.ukwrote:
rowe_newsgroups wrote:
On Jun 12, 8:35 am, Chris Diver <chris.di...@hotmail.co.ukwrote:
Omar Abid wrote:
>On 12 juin, 13:43, Chris Diver <chris.di...@hotmail.co.ukwrote:
>>Omar Abid wrote:
>>>Hi,
>>>I'm using my with a program to detect an internet connection.
>>>It return true when I'm connected, but even when I 'm disconnected it
>>>returns true
>>>I don't know why ?
>>>Thx
>>>Omar Abid
>>What command are you using?
>my.network
My.Computer.Network.IsAvailable works fine for me, although I just have
a single connection to a LAN.
You could always ping a few popular addresses to see if you have an
Internet connection. E.Gwww.google.com,http://www.microsoft.com,www.yahoo.c...hattheywillall be down at the same time.
You could send a webrequest in a try/catch statement, if it throws an
exception then there is a problem connecting to the internet and you are
not connected.
Also not having an active Internet connection doesn't mean that you are
not connected to a Network.
HTH,
Chris
You could always ping a few popular addresses to see if you have an
Internet connection. E.Gwww.google.com,http://www.microsoft.com,www.yahoo.c...hattheywillall be down at the same time.
Well, except for microsoft.com - I believe it's servers are configured
to refuse ping requests.
Thanks,
Seth Rowe
Cool, didn't know that.
The problem isn' t solved.
Notice that i have several servers on my PC, does that change the
connection ?
You mean it's pinging fine? Even when not connected?
Thanks,
Seth Rowe
No it don't ping
but my.computer.network.isavailable = true even when I'm not connected

I don't think you understood me then - I said to not use
Network.IsAvailable but to use Network.Ping. Networks are different
than internet connections - so Network.IsAvailable will not always
work.

Thanks,

Seth Rowe- Masquer le texte des messages précédents -

- Afficher le texte des messages précédents -
I think because i have front page and asp server running
By the way i used the code in up and that run correctly
Thx to you all
Omar Abid

Jun 12 '07 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3913
by: Dicky Cheng | last post by:
Hi, I am using .net remoting technology. I set up a .net remoting client and server in IIS. When the client calls the server, the server will run a long duration method (30-60seconds). I have a test on it that if the network broken at the time the client have already send the remoting request and waiting for the server, the client side will...
6
2376
by: John Walton | last post by:
Hello, everyone. I just began school, and they already assigned us science fair. Since I'm in 8th grade, I get to do demonstrations for our projects. I'm probably going to demonstrate Python's networking capabilities by writing a simple instant messenger program. I only have a few problems: 1. I know squat about Python network...
2
1798
by: Brent Burkart | last post by:
I have a utility that I want to only run when a network connection is present. I want to plan for the situation when someone unplugs their laptop from the network and takes it into another room. My process requires a connection and I don't want it to blow up when one does not exist. I have tried using the "wininet.dll" API, but it still...
3
2215
by: Agnes | last post by:
My client hold its MS SQL server in hkbranch, Both china and hong kong office can run the vb.net application very well via VPN. Now, they want to reduce cost and move the MS SQL server to china 's data centre . During testing period, the user cannot connect to the SQL server and alwasy got "General Network Error", we said that the network...
8
3007
by: BJ | last post by:
Problem: How can I code up a client side process to detect if the network is available? Synopsis: I am writing ASP.NET input forms for a Panasonic Tuff book. The users will be walking around the plant with a wireless connection. There are some pockets of non-connectivity. I've been tasked with disabling the submit button on the form if...
3
15509
by: Ryan Liu | last post by:
Hi, I use Server: Use an endless thread to lisiten to clients requests: while(true) { TcpClient client = myListener.AcceptTcpClient();
1
20553
by: Ryan Liu | last post by:
Hi, I have a 100 clients/ one server application, use ugly one thread pre client approach. And both side user sync I/O. I frequently see the error on server side(client side code is same, but I don't see the error): "System.IO.IOException: Unable to read data from the transport connection:A blocking operation was interrupted by a call...
4
16067
by: Prof. William Battersea | last post by:
Hello, Suppose I have a Vista machine called VISTA and an XP machine called XP in a workgroup named WORKGROUP. Physically they're connected to a router and I can see lists of public and shared files on each of them. How do I address these for IO? A search suggested that the form open(r"\\server\folder\folder"), but I tried many...
24
5773
by: Asja | last post by:
I have written an application that runs in a kind of peer-to-peer framework. Servers connect to a masterserver, which a client then queries to receive a list of servers. The client selects a server and connects to that server directly and both the server and client sever their connections with the masterserver. Problem: I have the masterserver...
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7563
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5703
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4757
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3239
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.