added SSCLI 1.0
[windows-sources.git] / sdk / samples / FrameworkSamples / NCL / NetworkInformation / readme.htm
blobc1e67e6c477a33c74f2436b2bd31e2265889412e
1 <html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8" /><META NAME="save" CONTENT="history" /><title xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt">Network Information Technology Sample</title><META NAME="Description" CONTENT="This sample shows how to create a Windows Forms application to monitor and display network information such as IP addresses, network interfaces, and statistics about network traffic to and from the local computer. These capabilities are provided by t ..."></META><META NAME="MS.LOCALE" CONTENT="en-us" /><style>
2 body
3 {font-family:Verdana;font-size:medium;}
4 div#mainSection, div#header
5 {font-size:70%;width: 100%;}
6 div#mainBody
7 {font-size:90%;}
8 div#mainSection div table
9 {font-size: 100%;text-align: left;}
10 span#nsrTitle
11 {color:#003399;font-size:90%;font-weight:600;}
12 div#header
13 {background-color:#D4DFFF;}
14 .heading
15 {font-size:120%;color:#003399;}
16 .subHeading
17 {font-size:100%;margin-bottom:4;}
19 {margin-top:-2;margin-bottom:3;}
21 {margin-top:10;margin-bottom:5;}
22 div.tableSection p
23 {margin-top:1;margin-bottom:4;}
24 div#mainSection table th
25 {background-color:#EFEFF7;color:#000066;text-align:left;}
26 div#mainSection table td
27 {background-color:#F7F7FF;}
28 div#mainSection table
29 {margin-top:5px;margin-bottom: px;}
30 </style></head><body><div id="header"><table width="100%" id="topTable"></table></div><div id="mainSection"><div id="mainBody"><br /><font color="DarkGray">[This readme is a partial copy of the sample's topic in the SDK documentation.]</font><br /><font color="DarkGray" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt"></font><p xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt"></p><div class="introduction"><p xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt">This sample shows how to create a Windows Forms application to monitor and display network information such as IP addresses, network interfaces, and statistics about network traffic to and from the local computer. These capabilities are provided by the types in the <span sdata="cer" target="N:System.Net.NetworkInformation">System.Net.NetworkInformation</span> namespace.</p><p xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt">For information about using the samples, see the following topics:</p><ul xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt"><li><p><span sdata="link">How to: View and Download Samples</span></p></li><li><p><span sdata="link">How to: Set Sample Settings</span></p></li></ul></div><h3 class="procedureSubHeading" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt">To build the sample using the command prompt</h3><div class="subSection"><ol xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt"><li><p>Open a Command Prompt window and navigate to one of the language-specific subdirectories under the NetworkInformation directory. For information about required settings and the SDK Command Prompt, see <span sdata="link">How to: Set Sample Settings</span>.</p></li><li><p>Type <span class="input">msbuild NetworkInformation.sln</span> at the command line. </p></li></ol></div><h3 class="procedureSubHeading" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt">To build the sample using Visual Studio</h3><div class="subSection"><ol xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt"><li><p>Open Windows Explorer and navigate to one of the language-specific subdirectories under the NetworkInformation directory.</p></li><li><p>Double-click the icon for NetworkInformation.sln to open the file in Visual Studio.</p></li><li><p>On the <span class="ui">Build</span> menu, click <span class="ui">Build Solution</span>.</p></li></ol><p xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt">The application is built in the default \bin or \bin\Debug directory.</p></div><h3 class="procedureSubHeading" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt">To run the sample</h3><div class="subSection"><ol xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt"><li><p>Navigate to the directory that contains the new executable, using the command prompt or Windows Explorer.</p></li><li><p>Type <span class="input">NetworkInformation.exe</span> at the command line, or double-click the icon for NetworkInformation.exe to launch it from Windows Explorer. </p></li></ol></div><h1 class="heading" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt"><span onclick="ExpandCollapse(sectionToggle0)" style="cursor:default;" onkeypress="ExpandCollapse_CheckKey(sectionToggle0, event)" tabindex="0">Remarks</span></h1><div id="sectionSection0" class="section"><p xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt">The sample application handles the <span sdata="cer" target="E:System.Net.NetworkInformation.NetworkChange.NetworkAddressChanged">NetworkAddressChanged</span> event with its NetworkChange_NetworkAddressChanged method. This method calls the UpdateNetworkInformation method, which repopulates the ComboBox control that contains the value of the <span sdata="cer" target="P:System.Net.NetworkInformation.NetworkInterface.Description">Description</span> property of each available <span sdata="cer" target="T:System.Net.NetworkInformation.NetworkInterface">NetworkInterface</span>.</p><p xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt">Review comments in the source code and build.proj files for more information about monitoring network statistics.</p></div><h1 class="heading" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt"><span onclick="ExpandCollapse(seeAlsoToggle)" style="cursor:default;" onkeypress="ExpandCollapse_CheckKey(seeAlsoToggle, event)" tabindex="0">See Also</span></h1><div id="seeAlsoSection" class="section"><h4 class="subHeading" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt">Reference</h4><div class="seeAlsoStyle"><span sdata="cer" target="T:System.Net.NetworkInformation.IPInterfaceProperties" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt">IPInterfaceProperties</span></div><div class="seeAlsoStyle"><span sdata="cer" target="T:System.Net.NetworkInformation.NetworkChange" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt">NetworkChange</span></div><div class="seeAlsoStyle"><span sdata="cer" target="T:System.Net.NetworkInformation.NetworkInterface" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt">NetworkInterface</span></div><div class="seeAlsoStyle"><span sdata="cer" target="T:System.Net.NetworkInformation.OperationalStatus" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt">OperationalStatus</span></div><div class="seeAlsoStyle"><span sdata="cer" target="N:System.Net.NetworkInformation" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt">System.Net.NetworkInformation</span></div></div></div></div></body></html>