OVH Cloud OVH Cloud

tester la connexion au réseau local

5 réponses
Avatar
tijani
Comment je peux savoir si mon PC est connect=E9 au r=E9seau=20
local?

5 réponses

Avatar
ng
Salut,

Cela dépend du système, mais en règle générale, il suffit de pinguer une
autre machine du réseau. Une petite recherche sur Google Groups permettra de
trouver des modules faisant cela.

--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/



tijani a écrit :

Comment je peux savoir si mon PC est connecté au réseau
local?


Avatar
Est ce que tu as des exemples de codes sources?
-----Message d'origine-----
Salut,

Cela dépend du système, mais en règle générale, il suffit


de pinguer une
autre machine du réseau. Une petite recherche sur Google


Groups permettra de
trouver des modules faisant cela.

--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
http://apisvb.europe.webmatrixhosting.net/



tijani a écrit :

Comment je peux savoir si mon PC est connecté au réseau
local?




.



Avatar
François Picalausa
Hello,

En cas de machines dont l'adresse est assignée dynamiquement, comment
pinguer?

Voici une autre solution:
Option Explicit

Private Enum NETWORK_ALIVE
NETWORK_ALIVE_LAN = &H1
NETWORK_ALIVE_WAN = &H2
NETWORK_ALIVE_AOL = &H4 'Win 95/98
End Enum

Private Declare Function IsNetworkAlive _
Lib "Sensapi" _
( _
lpdwFlags As Long _
) _
As Long

Private Sub Command1_Click()
Dim strOut As String

strOut = "LAN : "
If IsNetworkAlive(NETWORK_ALIVE_LAN) Then
strOut = strOut & "Activé"
Else
strOut = strOut & "Désactivé"
End If

strOut = strOut & vbCrLf & "WAN : "
If IsNetworkAlive(NETWORK_ALIVE_WAN) Then
strOut = strOut & "Activé"
Else
strOut = strOut & "Désactivé"
End If

strOut = strOut & vbCrLf & "LAN et WAN : "
If IsNetworkAlive(NETWORK_ALIVE_LAN Or NETWORK_ALIVE_WAN) Then
strOut = strOut & "Activé"
Else
strOut = strOut & "Désactivé"
End If

MsgBox strOut
End Sub

Attention les machines de destination doivent avoir au minimum:
Client: Included in Windows XP, Windows 2000 Professional, and Windows Me.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Redistributable: Requires Internet Explorer 5 or later on Windows NT 4.0 and
Windows 95/98.

--
François Picalausa (MVP VB)
http://faq.vb.free.fr --- http://msdn.microsoft.com
http://apisvb.europe.webmatrixhosting.net

"ng" a écrit dans le message de
news:
Cela dépend du système, mais en règle générale, il suffit de pinguer
une autre machine du réseau.

Comment je peux savoir si mon PC est connecté au réseau
local?




Avatar
tijani
Il me rend toujours LAN:Activé , soit le cable de réseau
branché ou non!!!!!!!!!!!!!!!!!!
-----Message d'origine-----
Hello,

En cas de machines dont l'adresse est assignée


dynamiquement, comment
pinguer?

Voici une autre solution:
Option Explicit

Private Enum NETWORK_ALIVE
NETWORK_ALIVE_LAN = &H1
NETWORK_ALIVE_WAN = &H2
NETWORK_ALIVE_AOL = &H4 'Win 95/98
End Enum

Private Declare Function IsNetworkAlive _
Lib "Sensapi" _
( _
lpdwFlags As Long _
) _
As Long

Private Sub Command1_Click()
Dim strOut As String

strOut = "LAN : "
If IsNetworkAlive(NETWORK_ALIVE_LAN) Then
strOut = strOut & "Activé"
Else
strOut = strOut & "Désactivé"
End If

strOut = strOut & vbCrLf & "WAN : "
If IsNetworkAlive(NETWORK_ALIVE_WAN) Then
strOut = strOut & "Activé"
Else
strOut = strOut & "Désactivé"
End If

strOut = strOut & vbCrLf & "LAN et WAN : "
If IsNetworkAlive(NETWORK_ALIVE_LAN Or


NETWORK_ALIVE_WAN) Then
strOut = strOut & "Activé"
Else
strOut = strOut & "Désactivé"
End If

MsgBox strOut
End Sub

Attention les machines de destination doivent avoir au


minimum:
Client: Included in Windows XP, Windows 2000


Professional, and Windows Me.
Server: Included in Windows Server 2003 and Windows 2000


Server.
Redistributable: Requires Internet Explorer 5 or later on


Windows NT 4.0 and
Windows 95/98.

--
François Picalausa (MVP VB)
http://faq.vb.free.fr --- http://msdn.microsoft.com
http://apisvb.europe.webmatrixhosting.net

"ng" a écrit dans le message de
news:
Cela dépend du système, mais en règle générale, il




suffit de pinguer
une autre machine du réseau.

Comment je peux savoir si mon PC est connecté au réseau
local?






.



Avatar
Zoury
Salut!

essai avec GetInternetConnectedState()
http://vbnet.mvps.org/code/network/internetgetconnectedstate.htm

--
Cordialement
Yanick Lefebvre - MVP pour Visual Basic
http://faq.vb.free.fr/?rubrique=0 - http://www.mvps.org/vbnet/
http://www.mentalis.org/agnet/apiguide.shtml - http://www.mztools.com/
"tijani" a écrit dans le message de
news:2a7001c4708c$67c65500$
Comment je peux savoir si mon PC est connecté au réseau
local?