Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SocketAddress.Item Property

Gets or sets the specified index element in the underlying buffer.

[C#] In C#, this property is the indexer for the SocketAddress class.

[Visual Basic]
Public Default Property Item( _
   ByVal offset As Integer _
) As Byte
[C#]
public byte this[
 int offset
] {get; set;}
[C++]
public: __property unsigned char get_Item(
 int offset
);
public: __property void set_Item(
 int offset,
   unsigned char
);
[JScript]
returnValue = SocketAddressObject.Item(offset);
SocketAddressObject.Item(offset) = returnValue;
-or-
returnValue = SocketAddressObject(offset);
SocketAddressObject(offset) = returnValue;

[JScript] In JScript, you can use the default indexed properties defined by a type, but you cannot explicitly define your own. However, specifying the expando attribute on a class automatically provides a default indexed property whose type is Object and whose index type is String.

Arguments [JScript]

offset
The array index element of the desired information.

Parameters [Visual Basic, C#, C++]

offset
The array index element of the desired information.

Property Value

The value of the specified index element in the underlying buffer.

Exceptions

Exception Type Condition
IndexOutOfRangeException The specified index does not exist in the buffer.

Remarks

This property gets or sets the specified byte position in the underlying buffer.

Note   Be sure to call Size before referring to elements in the underlying buffer. Referring to an index that does not exist will cause the SocketAddress to throw an IndexOutOfRangeException.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Common Language Infrastructure (CLI) Standard

See Also

SocketAddress Class | SocketAddress Members | System.Net Namespace | Size

Show:
© 2015 Microsoft