RouteCollection.SetItem(Int32, RouteBase) 方法

定義

取代指定索引處的路由。

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

參數

index
Int32

要取代的路由之以零為起始的索引。

item
RouteBase

要在指定索引處加入的路由。

例外狀況

itemnull

item 已經在集合中。

備註

當您將未命名的路由新增至 RouteCollection 物件時,無法新增已經在集合中的路由。

GetReadLock使用 方法和 GetWriteLock 方法,確定您與集合互動,而不會與其他進程發生衝突。

適用於

另請參閱