|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsAPICodePack.Net;
namespace Win7NewFeatures.NetworkManagement
{
public partial class frmNetworkInfo : Form
{
public frmNetworkInfo()
{
InitializeComponent();
}
private void frmNetworkInfo_Load(object sender, EventArgs e)
{
NetworkCollection networks = NetworkListManager.GetNetworks( NetworkConnectivityLevels.All);
foreach (Network n in networks)
{
lstNetworks.Items.Add(n.NetworkId);
}
}
private void lstNetworks_SelectedIndexChanged(object sender, EventArgs e)
{
if (lstNetworks.SelectedItem != null)
{
Guid NetworkID = new Guid(lstNetworks.SelectedItem.ToString());
Network 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();
NetworkConnectionCollection Connections = network.Connections ;
foreach (NetworkConnection Connection in network.Connections )
{
lstConnections.Items.Add("ConnectionID: " + Connection.ConnectionId );
lstConnections.Items.Add("Adapter ID:: " + Connection.AdapterId);
}
}
}
}
}
|
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.