Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to monitor the network?

1 view
Skip to first unread message

light_wt

unread,
Dec 25, 2009, 1:02:01 PM12/25/09
to
I have windows desktop application which heavily depends on the network to
talk to the back-end SQL server.

how would you monitor this network, such as, connectivity, bandwidth, and
router changes, etc?

William Vaughn (MVP)

unread,
Dec 29, 2009, 1:31:26 PM12/29/09
to

You can use .NET Framework API calls to check for network availability as
well as PING a known server (testing for response time). This is a snippet
from an example in my book. Perhaps it can get you started... Notice that
the NetworkAvailabilityChanged event fires when the net goes down (or back
up). The Net.Ping has several other flavors as well.

Dim WithEvents Net As New Devices.Network
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If My.Computer.Network.IsAvailable Then
If Net.Ping("localhost") = False Then
MsgBox("Local host not visible.")
End If
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
ShowStatus(My.Computer.Network.IsAvailable)
End Sub
Private Sub Net_NetworkAvailabilityChanged(ByVal sender As Object, _
ByVal e As Microsoft.VisualBasic.Devices.NetworkAvailableEventArgs)
_
Handles Net.NetworkAvailabilityChanged
ListBox1.Items.Add(String.Format("Network status changed to: {0}",
e.IsNetworkAvailable))
ShowStatus(e.IsNetworkAvailable)
End Sub

hth
--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
http://betav.com http://betav.com/blog/billva
____________________________________________________________________________________________

"light_wt" <lig...@discussions.microsoft.com> wrote in message
news:72F8049B-75E9-4A2A...@microsoft.com...

0 new messages