RouteCollection.InsertItem(Int32, RouteBase) 方法

定義

將指定的路由插入位於指定索引處的 RouteCollection 物件。

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

參數

index
Int32

插入 item 處之以零起始的索引。

item
RouteBase

要插入的路由。

例外狀況

itemnull

item 已經在集合中。

備註

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

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

適用於

另請參閱