共用方式為


IPAddress.Address Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Note: This API is now obsolete. The non-obsolete alternative is GetAddressBytes().

Gets or sets an Internet Protocol (IP) address for IPv4.

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

Syntax

'Declaration
<ObsoleteAttribute("This property has been deprecated. It is address family dependent. Please use IPAddress.Equals method to perform comparisons. https://go.microsoft.com/fwlink/?linkid=14202")> _
Public Property Address As Long
[ObsoleteAttribute("This property has been deprecated. It is address family dependent. Please use IPAddress.Equals method to perform comparisons. https://go.microsoft.com/fwlink/?linkid=14202")]
public long Address { get; set; }

Property Value

Type: System.Int64
An IPv4 address represented as an integer.

Exceptions

Exception Condition
SocketException

The AddressFamily property is InterNetworkV6.

Remarks

This property is obsolete. Use GetAddressBytes to get the IP address as an array of bytes.

The Address property is assumed to be in network byte order.

This property can only be used to get or set an IPv4 address, since the size of the long data type is not large enough for an IPv6 address.

To convert Address to dotted-decimal notation, use the ToString method.

Version Information

Silverlight

Obsolete (compiler warning) in 5
Obsolete (compiler warning) in 4
Obsolete (compiler warning) in 3

Silverlight for Windows Phone

Obsolete (compiler warning) in Windows Phone OS 7.1

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.