IPAddress Class

May 11, 2014

Provides an Internet Protocol (IP) address.

System.Object
  System.Net.IPAddress

Namespace:  System.Net
Assembly:  System.Net (in System.Net.dll)

public class IPAddress

The IPAddress type exposes the following members.

  NameDescription
Public methodIPAddress(Byte[])Initializes a new instance of the IPAddress class with the address specified as a Byte array.
Public methodIPAddress(Int64)Initializes a new instance of the IPAddress class with the address specified as an Int64.
Public methodIPAddress(Byte[], Int64)Initializes a new instance of the IPAddress class with an IPv6 address specified as a Byte array and the specified scope identifier.
Top

  NameDescription
Public propertyAddress Obsolete. Gets or sets an Internet Protocol (IP) address for IPv4.
Public propertyAddressFamilyGets the address family of the IP address.
Public propertyIsIPv6LinkLocalGets whether the address is an IPv6 link local address.
Public propertyIsIPv6MulticastGets whether the address is an IPv6 multicast global address.
Public propertyIsIPv6SiteLocalGets whether the address is an IPv6 site local address.
Public propertyScopeIdGets or sets the IPv6 address scope identifier.
Top

  NameDescription
Public methodEqualsCompares two IP addresses. (Overrides Object.Equals(Object).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetAddressBytesProvides a copy of the IPAddress as an array of bytes.
Public methodGetHashCodeReturns a hash value for an IP address. (Overrides Object.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodStatic memberHostToNetworkOrder(Int16)Converts a short value from host byte order to network byte order.
Public methodStatic memberHostToNetworkOrder(Int32)Converts an integer value from host byte order to network byte order.
Public methodStatic memberHostToNetworkOrder(Int64)Converts a long value from host byte order to network byte order.
Public methodStatic memberIsLoopbackIndicates whether the specified IP address is the loopback address.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodStatic memberNetworkToHostOrder(Int16)Converts a short value from network byte order to host byte order.
Public methodStatic memberNetworkToHostOrder(Int32)Converts an integer value from network byte order to host byte order.
Public methodStatic memberNetworkToHostOrder(Int64)Converts a long value from network byte order to host byte order.
Public methodStatic memberParseConverts an IP address string to an IPAddress instance.
Public methodToStringConverts an Internet address to its standard notation. (Overrides Object.ToString().)
Public methodStatic memberTryParseDetermines whether a string is a valid IP address.
Top

  NameDescription
Public fieldStatic memberAnyProvides an IPv4 address that indicates that a server must listen for client activity on all network interfaces for IPv4. This field is read-only.
Public fieldStatic memberBroadcastProvides the IPv4 broadcast address. This field is read-only.
Public fieldStatic memberIPv6AnyProvides an IPv6 address that indicates that a server must listen for client activity on all network interfaces for IPv6. This field is read-only.
Public fieldStatic memberIPv6LoopbackProvides the IP loopback address. This property is read-only.
Public fieldStatic memberIPv6NoneProvides an IPv6 address that indicates that no network interface should be used. This property is read-only.
Public fieldStatic memberLoopbackProvides the IPv4 loopback address. This field is read-only.
Public fieldStatic memberNoneProvides an IP address that indicates that no network interface should be used. This field is read-only.
Top

The IPAddress class contains the address of a computer on an IP network. This class can be used to represent either an IPv4 or IPv6 address.

Capabilities

If you use this API in your app, you must specify the following capabilities in the app manifest. Otherwise, your app might not work correctly or it might exit unexpectedly.

ID_CAP_NETWORKING

Windows Phone 8, Windows Phone OS 7.1

For more info, see App capabilities and hardware requirements for Windows Phone 8.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Show:
© 2014 Microsoft