IPv4InterfaceProperties クラスとは? わかりやすく解説

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

IPv4InterfaceProperties クラス

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

インターネット プロトコル Version 4 (IPv4) をサポートしているネットワーク インターフェイスに関する情報提供します

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

Public MustInherit Class
 IPv4InterfaceProperties
Dim instance As IPv4InterfaceProperties
public abstract class IPv4InterfaceProperties
public ref class IPv4InterfaceProperties abstract
public abstract class IPv4InterfaceProperties
public abstract class IPv4InterfaceProperties
解説解説
使用例使用例

GetIPv4Properties オブジェクト取得して、そのデータ表示するコード例次に示します

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.Object
  System.Net.NetworkInformation.IPv4InterfaceProperties
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
IPv4InterfaceProperties メンバ
System.Net.NetworkInformation 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「IPv4InterfaceProperties クラス」の関連用語

IPv4InterfaceProperties クラスのお隣キーワード
検索ランキング

   

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



IPv4InterfaceProperties クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS