語言

IPEndPointCollection.SetItem(Int32, IPEndPoint) 方法

定義

替換 IPEndPoint 指定索引的元素。

protected:
 override void SetItem(int index, System::Net::IPEndPoint ^ item);
protected override void SetItem(int index, System.Net.IPEndPoint item);
override this.SetItem : int * System.Net.IPEndPoint -> unit
Protected Overrides Sub SetItem (index As Integer, item As IPEndPoint)

參數

index
Int32

要替換的元素的零基指數。

item
IPEndPoint

該元素在指定索引處的新 IPEndPoint 值。 值可以是 null 參考型別。

例外狀況

參數 index 小於零

-或-

參數 index 大於目前 中 IPEndPointCollection項目的數量。

參數 item 為 null。

備註

IPEndPointCollection 不接受 null 為有效值。 IPEndPointCollection 允許元素重複。

此方法是 O(1) 作業。

適用於