|
Imports Microsoft.WindowsAPICodePack.Net
Public Class frmNetworkInfo
Private Sub lstNetworks_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstNetworks.SelectedIndexChanged
If lstNetworks.SelectedItem IsNot Nothing Then
Dim NetworkID As New Guid(lstNetworks.SelectedItem.ToString())
Dim network As Network = NetworkListManager.GetNetwork(NetworkID)
txtName.Text = network.Name
txtDecription.Text = network.Description
txtDomainType.Text = network.DomainType.ToString()
chkIsConnected.Checked = network.IsConnected
chInternet.Checked = network.IsConnectedToInternet
txtCategory.Text = network.Category.ToString()
txtCreatedTime.Text = network.CreatedTime.ToString()
txtConnectedTime.Text = network.ConnectedTime.ToString()
txtConnectivity.Text = network.Connectivity.ToString()
Dim Connections As NetworkConnectionCollection = network.Connections
For Each Connection As NetworkConnection In network.Connections
lstConnections.Items.Add("ConnectionID: " & Connection.ConnectionId.ToString)
lstConnections.Items.Add("Adapter ID:: " & Connection.AdapterId.ToString)
Next
End If
End Sub
Private Sub frmNetworkInfo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim networks As NetworkCollection = NetworkListManager.GetNetworks(NetworkConnectivityLevels.All)
For Each n As Network In networks
lstNetworks.Items.Add(n.NetworkId)
Next
End Sub
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.