Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Visual Basic 6 - Interrogare un computer in rete per vedere se ancora connesso alla rete
Forum - Visual Basic 6 - Interrogare un computer in rete per vedere se ancora connesso alla rete

Avatar
visualrenzo (Normal User)
Pro


Messaggi: 94
Iscritto: 15/05/2009

Segnala al moderatore
Postato alle 18:18
Giovedì, 10/02/2011
Buonasera ho un problema.
Ho dei computer in rete e vorrei ogni tanto interrogarli per vedere se sono acnora connessi alla rete dato che in wi fi la rete cade spesso.

Hotrovato qualcosa ma non  funziona

' Usage
Dim value As Boolean = My.Computer.Network.Ping(hostNameOrAddress)
Dim value As Boolean = My.Computer.Network.Ping(address)
Dim value As Boolean = My.Computer.Network.Ping(hostNameOrAddress ,timeout)
Dim value As Boolean = My.Computer.Network.Ping(address ,timeout)
' Declaration
Public Function Ping( _
   ByVal hostNameOrAddress As String _
) As Boolean
' -or-
Public Function Ping( _
   ByVal address As System.Uri _
) As Boolean
' -or-
Public Function Ping( _
   ByVal hostNameOrAddress As String, _
   ByVal timeout As Integer _
) As Boolean
' -or-
Public Function Ping( _
   ByVal address As System.Uri, _
   ByVal timeout As Integer _
) As Boolean


if My.Computer.Network.Ping("198.01.01.01") Then
   MsgBox("Server pinged successfully.")
Else
   MsgBox("Ping request timed out.")
End If



non riesco a trovare l' oggetto my.computer.network ecc  qualcuno ha idea ?

grazie

PM Quote
Avatar
visualrenzo (Normal User)
Pro


Messaggi: 94
Iscritto: 15/05/2009

Segnala al moderatore
Postato alle 18:19
Giovedì, 10/02/2011
Testo quotato

Postato originariamente da visualrenzo:

Buonasera ho un problema.
Ho dei computer in rete e vorrei ogni tanto interrogarli per vedere se sono acnora connessi alla rete dato che in wi fi la rete cade spesso.

Hotrovato qualcosa ma non  funziona

' Usage
Dim value As Boolean = My.Computer.Network.Ping(hostNameOrAddress)
Dim value As Boolean = My.Computer.Network.Ping(address)
Dim value As Boolean = My.Computer.Network.Ping(hostNameOrAddress ,timeout)
Dim value As Boolean = My.Computer.Network.Ping(address ,timeout)
' Declaration
Public Function Ping( _
   ByVal hostNameOrAddress As String _
) As Boolean
' -or-
Public Function Ping( _
   ByVal address As System.Uri _
) As Boolean
' -or-
Public Function Ping( _
   ByVal hostNameOrAddress As String, _
   ByVal timeout As Integer _
) As Boolean
' -or-
Public Function Ping( _
   ByVal address As System.Uri, _
   ByVal timeout As Integer _
) As Boolean


if My.Computer.Network.Ping("198.01.01.01") Then
   MsgBox("Server pinged successfully.")
Else
   MsgBox("Ping request timed out.")
End If



non riesco a trovare l' oggetto my.computer.network ecc  qualcuno ha idea ?

grazie



dimenticavo, uso vb 6

PM Quote
Avatar
HeDo (Founder Member)
Guru^2


Messaggi: 2765
Iscritto: 21/09/2007

Segnala al moderatore
Postato alle 20:23
Giovedì, 10/02/2011

ti sfugge clamorosamente che quello è VB.NET non vb6
in vb6 devi fare tutto a manina con le api del ping

http://www.sockets.com/ms_icmp.htm

PM Quote