次の方法で共有


IPAddress.Address プロパティ

メモ : このメンバは旧バージョン用です。

IPAddress.Address は、アドレス ファミリによって異なります。比較には Equals メソッドを使用します。

インターネット プロトコル (IP) アドレス。

<Obsolete("IPAddress.Address is address family dependant, use _
   Equals method for comparison.", False)>
Public Property Address As Long
[C#]
[Obsolete("IPAddress.Address is address family dependant, use
   Equals method for comparison.", false)]
public long Address {get; set;}
[C++]
[Obsolete("IPAddress.Address is address family dependant, use
   Equals method for comparison.", false)]
public: __property __int64 get_Address();public: __property void set_Address(__int64);
[JScript]
public
   Obsolete("IPAddress.Address is address family dependant, use Equals
   method for comparison.", false)
function get Address() : long;public function set Address(long);

プロパティ値

IP アドレスの long 値。

解説

このプロパティは今後使用しません。代わりに、 GetAddressBytes を使用してください。

Address をピリオド区切りの 10 進表記に変換するには、 ToString メソッドを使用します。

使用例

[Visual Basic, C#, C++] Address パラメータを使用して、 IPAddress インスタンスの IP アドレスを取得する例を次に示します。

 

    Public Sub PrintAddress(IpAddressString As [String])
        ' Creates an instance of the IPAddress' for the specified IP string in dotted-quad notation.
        Dim hostIPAddress As IPAddress = IPAddress.Parse(IpAddressString)
        Console.WriteLine(ControlChars.Cr + "The IP address '" + IpAddressString + "' is {0}", hostIPAddress.ToString())
    End Sub 'PrintAddressFamily


[C#] 
public void PrintAddress(String IpAddressString)
{
  // Creates an instance of the IPAddress for the specified IP string in 
  // dotted-quad notation. 
  IPAddress hostIPAddress = IPAddress.Parse(IpAddressString);
  Console.WriteLine("\nThe IP address '" + IpAddressString + "' is {0}", hostIPAddress.ToString()); 
}

[C++] 
void PrintAddress(String* IpAddressString) {
   // Creates an instance of the IPAddress for the specified IP String* in
   // dotted-quad notation.
   IPAddress* hostIPAddress = IPAddress::Parse(IpAddressString);
   Console::WriteLine(S"\nInteger value of IP address {0} is {1}", IpAddressString, __box( hostIPAddress->Address));
}

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET, Common Language Infrastructure (CLI) Standard

参照

IPAddress クラス | IPAddress メンバ | System.Net 名前空間