IPGlobalProperties::GetIPv6GlobalStatistics Method ()
Provides Internet Protocol version 6 (IPv6) statistical data for the local computer.
Assembly: System (in System.dll)
Return Value
Type: System.Net.NetworkInformation::IPGlobalStatistics^An IPGlobalStatistics object that provides IPv6 traffic statistics for the local computer.
| Exception | Condition |
|---|---|
| NetworkInformationException | The call to the Win32 function GetIpStatistics failed. |
| PlatformNotSupportedException | The local computer is not running an operating system that supports IPv6. |
IPv6 is a network layer protocol responsible for routing data packets from its source computer to its destination. The IPv6 protocol is not supported on computers with Windows 2000 or earlier operating systems.
For details on the IP traffic statistics available to applications, see the IPGlobalStatistics class documentation. Note that the object returned by this method reflects the statistics as of the time the IPGlobalStatistics object is created. This information is not updated dynamically.
The following code example displays IP statistics for the local computer.
void ShowIPStatistics( NetworkInterfaceComponent version ) { IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties(); IPGlobalStatistics ^ ipstat = nullptr; switch ( version ) { case NetworkInterfaceComponent::IPv4: ipstat = properties->GetIPv4GlobalStatistics(); Console::WriteLine( "{0}IPv4 Statistics ", Environment::NewLine ); break; case NetworkInterfaceComponent::IPv6: ipstat = properties->GetIPv4GlobalStatistics(); Console::WriteLine( "{0}IPv6 Statistics ", Environment::NewLine ); break; default: throw gcnew ArgumentException( "version" ); break; } Console::WriteLine( " Forwarding enabled ...................... : {0}", ipstat->ForwardingEnabled ); Console::WriteLine( " Interfaces .............................. : {0}", ipstat->NumberOfInterfaces ); Console::WriteLine( " IP addresses ............................ : {0}", ipstat->NumberOfIPAddresses ); Console::WriteLine( " Routes .................................. : {0}", ipstat->NumberOfRoutes ); Console::WriteLine( " Default TTL ............................. : {0}", ipstat->DefaultTtl ); Console::WriteLine( "" ); Console::WriteLine( " Inbound Packet Data:" ); Console::WriteLine( " Received ............................ : {0}", ipstat->ReceivedPackets ); Console::WriteLine( " Forwarded ........................... : {0}", ipstat->ReceivedPacketsForwarded ); Console::WriteLine( " Delivered ........................... : {0}", ipstat->ReceivedPacketsDelivered ); Console::WriteLine( " Discarded ........................... : {0}", ipstat->ReceivedPacketsDiscarded ); Console::WriteLine( " Header Errors ....................... : {0}", ipstat->ReceivedPacketsWithHeadersErrors ); Console::WriteLine( " Address Errors ...................... : {0}", ipstat->ReceivedPacketsWithAddressErrors ); Console::WriteLine( " Unknown Protocol Errors ............. : {0}", ipstat->ReceivedPacketsWithUnknownProtocol ); Console::WriteLine( "" ); Console::WriteLine( " Outbound Packet Data:" ); Console::WriteLine( " Requested ........................... : {0}", ipstat->OutputPacketRequests ); Console::WriteLine( " Discarded ........................... : {0}", ipstat->OutputPacketsDiscarded ); Console::WriteLine( " No Routing Discards ................. : {0}", ipstat->OutputPacketsWithNoRoute ); Console::WriteLine( " Routing Entry Discards .............. : {0}", ipstat->OutputPacketRoutingDiscards ); Console::WriteLine( "" ); Console::WriteLine( " Reassembly Data:" ); Console::WriteLine( " Reassembly Timeout .................. : {0}", ipstat->PacketReassemblyTimeout ); Console::WriteLine( " Reassemblies Required ............... : {0}", ipstat->PacketReassembliesRequired ); Console::WriteLine( " Packets Reassembled ................. : {0}", ipstat->PacketsReassembled ); Console::WriteLine( " Packets Fragmented .................. : {0}", ipstat->PacketsFragmented ); Console::WriteLine( " Fragment Failures ................... : {0}", ipstat->PacketFragmentFailures ); Console::WriteLine( "" ); }
for reading network information. Associated enumeration: Read.
Available since 2.0