IPGlobalStatistics.ForwardingEnabled Свойство

Определение

Возвращает значение типа Boolean, которое указывает, разрешена ли переадресация IP-пакетов.

public:
 abstract property bool ForwardingEnabled { bool get(); };
public abstract bool ForwardingEnabled { get; }
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
public abstract bool ForwardingEnabled { get; }
member this.ForwardingEnabled : bool
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
member this.ForwardingEnabled : bool
Public MustOverride ReadOnly Property ForwardingEnabled As Boolean

Значение свойства

Значение типа Boolean, которое указывает, разрешена ли переадресация пакетов.

Атрибуты

Примеры

В следующем примере кода отображается значение этого свойства.

void ShowIPStatistics()
{
   IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
   IPGlobalStatistics ^ ipstat = properties->GetIPv4GlobalStatistics();
   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 );
}
public static void ShowIPStatistics()
{
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    IPGlobalStatistics ipstat = properties.GetIPv4GlobalStatistics();
    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);
}
Public Shared Sub ShowIPStatistics() 
    Dim properties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
    Dim ipstat As IPGlobalStatistics = properties.GetIPv4GlobalStatistics()
    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)

End Sub

Комментарии

Это значение определяет, пересылает ли компьютер IP-датаграммы, предназначенные для другого компьютера. Как правило, маршрутизаторы пересылают пакеты и хост-компьютеры.

Применяется к