语言

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

要插入的路由。

例外

item 是 null。

item 已在集合中。

注解

向对象添加未命名路由 RouteCollection 时,无法添加集合中已有的路由。

GetReadLock使用方法和GetWriteLock方法确保与集合交互,而不会与其他进程发生冲突。

适用于

另请参阅