NetworkInterfaceComponent 列挙体とは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > NetworkInterfaceComponent 列挙体の意味・解説 

NetworkInterfaceComponent 列挙体

メモ : この列挙体は、.NET Framework version 2.0新しく追加されたものです。

ネットワーク インターフェイスサポートされインターネット プロトコルバージョン示します

名前空間: System.Net.NetworkInformation
アセンブリ: System (system.dll 内)
構文構文

Public Enumeration NetworkInterfaceComponent
Dim instance As NetworkInterfaceComponent
public enum NetworkInterfaceComponent
public enum class NetworkInterfaceComponent
public enum NetworkInterfaceComponent
public enum NetworkInterfaceComponent
メンバメンバ
解説解説
使用例使用例

ネットワーク インターフェイスIPv4サポートしているかどうかチェックするコード例次に示します

Public Shared Sub DisplayIPv4NetworkInterfaces()
 
    Dim nics As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces()
    Dim properties As IPGlobalProperties =
 IPGlobalProperties.GetIPGlobalProperties()
    Console.WriteLine("IPv4 interface information for {0}.{1}",
 properties.HostName, properties.DomainName)
    
    Dim adapter As NetworkInterface
    For Each adapter In
  nics
        ' Only display informatin for interfaces that support IPv4.
        If adapter.Supports(NetworkInterfaceComponent.IPv4) =
 False Then
            GoTo ContinueForEach1
        End If
        Console.WriteLine()
        Console.WriteLine(adapter.Description)
        ' Underline the description.
        Console.WriteLine(String.Empty.PadLeft(adapter.Description.Length,
 "="c))
        Dim adapterProperties As IPInterfaceProperties
 = adapter.GetIPProperties()
        ' Try to get the IPv4 interface properties.
        Dim p As IPv4InterfaceProperties =
 adapterProperties.GetIPv4Properties()
        
        If p Is Nothing
 Then
            Console.WriteLine("No IPv4 information is available
 for this interface.")
            GoTo ContinueForEach1
        End If
        ' Display the IPv4 specific data.
        Console.WriteLine("  Index .............................
 : {0}", p.Index)
        Console.WriteLine("  MTU ...............................
 : {0}", p.Mtu)
        Console.WriteLine("  APIPA active.......................
 : {0}", p.IsAutomaticPrivateAddressingActive)
        Console.WriteLine("  APIPA enabled......................
 : {0}", p.IsAutomaticPrivateAddressingEnabled)
        Console.WriteLine("  Forwarding enabled.................
 : {0}", p.IsForwardingEnabled)
        Console.WriteLine("  Uses WINS .........................
 : {0}", p.UsesWins)
    ContinueForEach1:
    Next adapter

End Sub 'DisplayIPv4NetworkInterfaces

public static void DisplayIPv4NetworkInterfaces()
{
    NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    Console.WriteLine("IPv4 interface information for {0}.{1}"
,
       properties.HostName, properties.DomainName);

    foreach (NetworkInterface adapter in nics)
    {
        // Only display informatin for interfaces that support IPv4.
        if (adapter.Supports(NetworkInterfaceComponent.IPv4) ==
 false)
        {
            continue;
        }
        Console.WriteLine();
        Console.WriteLine(adapter.Description);
        // Underline the description.
        Console.WriteLine(String.Empty.PadLeft(adapter.Description.Length,'='));
        IPInterfaceProperties adapterProperties = adapter.GetIPProperties();
        // Try to get the IPv4 interface properties.
        IPv4InterfaceProperties p = adapterProperties.GetIPv4Properties();
        
        if (p == null)
        {
            Console.WriteLine("No IPv4 information is available for
 this interface.");
            continue;
        }
        // Display the IPv4 specific data.
        Console.WriteLine("  Index ............................. : {0}",
 p.Index);
        Console.WriteLine("  MTU ............................... : {0}",
 p.Mtu);
        Console.WriteLine("  APIPA active....................... : {0}",
 
            p.IsAutomaticPrivateAddressingActive);
        Console.WriteLine("  APIPA enabled...................... : {0}",
 
            p.IsAutomaticPrivateAddressingEnabled);
        Console.WriteLine("  Forwarding enabled................. : {0}",
 
            p.IsForwardingEnabled);
         Console.WriteLine("  Uses WINS ......................... : {0}",
 
            p.UsesWins);
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
System.Net.NetworkInformation 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  
  •  NetworkInterfaceComponent 列挙体のページへのリンク

辞書ショートカット

すべての辞書の索引

「NetworkInterfaceComponent 列挙体」の関連用語

1
NetworkInterface.OperationalStatus プロパティ .NET Framework クラス ライブラリ リファレンス
34% |||||

2
IPGlobalProperties.GetUdpIPv4Statistics メソッド .NET Framework クラス ライブラリ リファレンス
32% |||||

3
IPGlobalProperties.GetUdpIPv6Statistics メソッド .NET Framework クラス ライブラリ リファレンス
32% |||||

4
OperationalStatus 列挙体 .NET Framework クラス ライブラリ リファレンス
32% |||||

5
IPGlobalProperties.GetIPv4GlobalStatistics メソッド .NET Framework クラス ライブラリ リファレンス
18% |||||

6
IPGlobalProperties.GetIPv6GlobalStatistics メソッド .NET Framework クラス ライブラリ リファレンス
18% |||||

7
IPGlobalProperties.GetTcpIPv4Statistics メソッド .NET Framework クラス ライブラリ リファレンス
18% |||||

8
IPGlobalProperties.GetTcpIPv6Statistics メソッド .NET Framework クラス ライブラリ リファレンス
18% |||||

9
NetworkInterface クラス .NET Framework クラス ライブラリ リファレンス
18% |||||

10
System.Net.NetworkInformation 名前空間 .NET Framework クラス ライブラリ リファレンス
10% |||||

検索ランキング

   

英語⇒日本語
日本語⇒英語
   



NetworkInterfaceComponent 列挙体のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS