Bagikan melalui


IPGlobalStatistics.ForwardingEnabled Properti

Definisi

Boolean Mendapatkan nilai yang menentukan apakah penerusan paket Protokol Internet (IP) diaktifkan.

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

Nilai Properti

Boolean Nilai yang menentukan apakah penerusan paket diaktifkan.

Atribut

Contoh

Contoh kode berikut menampilkan nilai properti ini.

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

Keterangan

Nilai ini menentukan apakah komputer meneruskan datagram IP yang ditujukan untuk komputer lain. Biasanya, router meneruskan paket dan komputer host tidak.

Berlaku untuk